BT

Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ

Topics

Choose your language

InfoQ Homepage News restQL V3 Released

restQL V3 Released

Leia em Português

This item in japanese

The latest version of restQL, a microservices query language, has been released, providing notable new features including content aggregation, support for additional HTTP methods, self-healing functionality, and a version for node.js apps. Comprehensive performance improvements have made the latest version up to twice as fast as its predecessor. There are no breaking changes from V2 to V3, so users can safely upgrade. Code for the open-source project is available under an MIT license.

RestQL is intended to simplify front-end code that needs to query multiple microservices. While a microservices architecture can make backend systems easier to support and maintain, a common, unintended consequence is additional complexity being pushed into the front-end application layer. RestQL reduces the complexity of orchestrating calls to multiple microservices, and leverages native browser caching functionality due to its use of standard HTTP calls.

One of restQL's defining characteristics has been automatic parallel calls to separate resources. However, the individual responses would also be separated, requiring the client to consolidate related objects, such as a customer with multiple orders. In the latest version, the new in operator allows the developer to specify the aggregation structure up front in the query, resulting in a single, combined result.

The latest version offers improved resilience of the restQL server, which sits between clients and the microservice APIs. When the system detects it is getting overloaded, it introduces a form a backpressure. A configuration setting defines the threshold for acceptable processing time overhead. If that threshold is reached, the system will start returning HTTP 507 responses (insufficient storage) for some requests, while allowing a portion of requests to continue executing successfully.

This pattern of returning failed responses requires the application to have some form of retry logic. Ricardo Mayerhofer, one of the creators of restQL, said this is something often implemented using a service mesh, such as Istio. "We advise using service meshes along with restQL. Due to the HTTP and REST nature of restQL, it plays nicely with service meshes (for both the incoming query and outgoing calls). Because it's common to have an auto-scaling algorithm, it's just a matter of time until new nodes are spun up and restQL is back to normal."

Earlier versions of restQL only supported querying data, by using the from keyword, which translated to an HTTP GET request. V3 adds the standard set of HTTP verbs for CRUD operations, including POST, PUT, and DELETE, through the keywords to, into, and delete, respectively.

The creators of restQL realized that standing up and maintaining an additional server could be a barrier to adoption, so they have created an npm package for node applications, @b2wdigital/restql. The corresponding GitHub page includes implementation code samples.

Mayerhofer describes more of the features of restQL V3 in a recent blog post. InfoQ previously covered the initial release and origin of the language.

Rate this Article

Adoption
Style

BT