What GraphQL Brings To Data Access

Kingsley Uyi Idehen
OpenLink Virtuoso Weblog
5 min readOct 5, 2022

Data remains the fundamental fuel that drives computing while emerging trends paradoxically remain an area rife with confusion. In this post, I will cover the emergence of GraphQL as a new addition to the collection of data access technologies that enable connectivity between clients and a variety of data source types, and the benefits it offers.

Data Access Backgrounder

Data access technologies have always fallen into two fundamental categories: data source-specific, and data source-independent.

Data Source-Specific Data Access

Unfortunately, this remains the predominant form of data access despite its predictable delivery of applications and services are that are inherently expensive to maintain, past any proof-of-concept rollout, due to rapidly evolving trends in data models, formats, access protocols, and interaction patterns (e.g., RPC vs Document-Oriented Middleware).

Data Source-Independent Data Access

Unfortunately, this isn’t the predominant form of data access despite its inherent benefits when developing enterprise applications and services, where client applications are loosely-coupled with backend database management systems (DBMS).

ODBC

Historically, Open Database Connectivity (ODBC) from Microsoft ushered in the first wave of broadly adopted DBMS-independent data access technology — delivered as a Windows-specific application programming interface (API) that was subsequently ported to other operating systems such as Linux, macOS, and others.

JDBC

Java Database Connectivity (JDBC) (originally from Sun, now part of Oracle) followed quickly on the heels of ODBC to deliver equivalent functionality for Java applications and services.

HTTP

The HTTP protocol and its various interaction patterns offer a new and modern approach to data access that goes beyond the value delivered by both ODBC and JDBC, courtesy of its ability to enable APIs at the wire-protocol level that leverage built-in cache invalidation, negotiable data representation format, operating system independence, and interaction pattern variety, that cater to both RPC (e.g., SOAP and gRPC) or Document Oriented Middleware modalities (REST).

This protocol’s sophistication is vast, as demonstrated by the World Wide Web that it enabled, which means it can be a source of confusion, too! For instance, HTTP enables the creation of data access technologies that combine query language constructs, data representation formats, and wire protocols as part of a single API deliverable, which is where SQL (via XML for Analysis), SPARQL (via SPARQL payloads for HTTP), and GraphQL (via GraphQL payloads for HTTP) come into play.

Quick GraphQL Introduction

GraphQL is the latest addition to a collection of HTTP-based data access APIs that comprises a query language, wire protocol, and query solution data format. It has been broadly adopted by HTTP-application (or Web Application) developers due to its use of JSON for query solution representation and a JSON-like payload format for query construction and dispatch.

GraphQL isn’t a RESTful interaction pattern alternative, per se, since you can actually perform powerful RESTful interactions with data sources using GraphQL payloads dispatched over HTTP.

Benefits

Today, data sources extend beyond conventional DBMS platforms. Websites themselves are evolving into structured data sources comprising HTML documents functioning as Digital Twins derived from structured data islands that manifest as Knowledge Graphs.

In this context, GraphQL provides a valuable and modern option for developing and deploying applications and services that are data source-independent. It achieves this by simplifying the pursuit of loose-coupling by way of its bindings to JSON (a graph oriented notation and representation format) which already has a broad ecosystem of critical productivity tools required by developers seeking low-learning-curve options.

Implementation Strategies for DBMS Technology Providers

A number of GraphQL support strategies have emerged over time, including the following:

  • Existing providers of DBMS technology (Relational Tables and/or Graphs) adding support to their existing data access APIs
  • DBMS Independent Middleware technology vendors adding support to their APIs
  • Web Services providers adding support to their Service-specific APIs

Implementation Strategy Example

As a combined DBMS and Middleware technology vendor, OpenLink Software has added native GraphQL support to its Virtuoso platform, that uniquely offers access to ODBC- and (via ODBC-to-JDBC Bridge) JDBC-accessible Relational Tables, SPARQL-accessible Graphs, HTTP-accessible Web Pages, and HTTP API-accessible Third Party Web Services. Together, these bring the cost-effectiveness of data source-independent application and development to both web and enterprise developers.

In addition to all of this, Virtuoso also addresses critical issues such as caching, data security, and unambiguous entity-naming using live hyperlinks that function as globally-resolvable Superkeys.

Here’s an illustration of the Virtuoso implementation strategy depicting how GraphQL offers an additional HTTP-based wire protocol for interacting with relational tables.

Implementation Strategy Use-case Example

ODBC-accessible Data

GraphQL, SPARQL, SQL and Data Access across a variety of Relational Database Management System Types

GraphQL access to the Northwind Database, which is already SQL- and SPARQL-accessible. Net effect: Customers, Orders, Products, and Product Categories are directly accessible as a Knowledge Graph, where the whole graph (or snippets thereof) are available to GraphQL clients.

HTTP-Accessible Data

GraphQL, SPARQL, SQL and Data Access across a variety of Data Source Type

GraphQL access to data snippets from the largest publicly accessible Knowledge Graph on the planet. Net effect: access to data from DBpedia, Wikidata, and other hubs via GraphQL while also leveraging RESTful interaction for additional exploration that starts from the content of query solution payloads.

HTML-based Structured Data Islands and 3rd Party APIs

GraphQL access to Products, Offers, Job Postings, etc., deployed as Knowledge Graphs embedded in Web Pages.

Conclusion

GraphQL provides a useful addition to the cocktail of data access middleware solutions that leverage the hyper-connectivity enabled by the HTTP protocol. For instance, as implemented in our Virtuoso Platform, it can actually offer a simple integration point into the notion of a “Web of Data” enabled by entity denotation (naming) using hyperlinks.

Related

--

--

Kingsley Uyi Idehen
OpenLink Virtuoso Weblog

CEO, OpenLink Software —High-Performance Data Centric Technology Providers.