BT

restQL, a Microservices Query Language, Released on GitHub

| by Thomas Betts Follow 5 Followers on Jan 11, 2018. Estimated reading time: 2 minutes |

A note to our readers: As per your request we have developed a set of features that allow you to reduce the noise, while not losing sight of anything that is important. Get email and web notifications by choosing the topics you are interested in.

restQL, a query language for microservices, is now available as an open-source project under an MIT license. The restQL language is intended to simplify common scenarios for client-side access to RESTful microservices, including multiple parallel calls and chained calls. Developed by B2W, the largest e-commerce operation in Latin America, restQL was created to avoid some limitations of the more well-known data querying and management frameworks Falcor and GraphQL.

While Falcor is only available to JavaScript clients, restQL is available to any client that supports REST calls over HTTP. This allows for its use in mobile apps written in Swift and Java. Although GraphQL is now a mature language for querying data, it doesn't provide some of the simple or well-established features available for RESTful services, such as HTTP response codes or native browser caching.

Similar to other querying languages, restQL statements describe the resources to retrieve, filtered by parameters. For example:

	from hero
	    with
        name = "Restman"

By default, queries are executed in parallel, without any special syntax. More complex, but common scenarios, such as chained or multiplexed calls (example below) are also straightforward.

	from hero
	    with
	        name = "Restman"
	
	from sidekick
	    with
	        hero = hero.id

Parsing and responding to restQL queries is handled by the restQL server. The server, implemented in Clojure, acts as a bridge between clients that submit restQL queries and backend APIs. Only configuration information is stored on the server, to pair resource names with the corresponding invocation endpoints. Because the restQL server exposes a standard REST endpoint, a specialized client is not required.

In a blog post announcing restQL, Ricardo Mayerhofer, IT Manager at B2W Digital, and one of the authors of restQL, said the project came about during the company's microservices migration. The development teams quickly benefitted from a move to microservices, with smaller applications to support, and corresponding easier maintenance. However, front-end code became more complex, having to orchestrate calls to multiple microservices, instead of a single, large call to the old monolith. Mayerhofer summarized their experience, saying, "A microservice-based architecture isn't a silver bullet. Despite its immediate benefits to the service teams, it poses by its very nature a challenge in terms of complexity and performance to the consumers." After considering Falcor and GraphQL, restQL was developed, and proved instrumental in simplifying client access to the multitude of backend services.

More information about restQL can be found at the project home page at http://restql.b2w.io/. The source code is available on GitHub.

Rate this Article

Adoption Stage
Style

Hello stranger!

You need to Register an InfoQ account or or login to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Tell us what you think

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread
Community comments

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Discuss

Login to InfoQ to interact with what matters most to you.


Recover your password...

Follow

Follow your favorite topics and editors

Quick overview of most important highlights in the industry and on the site.

Like

More signal, less noise

Build your own feed by choosing topics you want to read about and editors you want to hear from.

Notifications

Stay up-to-date

Set up your notifications and don't miss out on content that matters to you

BT