Announcing Hasura GraphQL Engine 2.0!

So, what is Hasura 2.0?

  1. Connect multiple databases simultaneously and database generalization
  2. Support for REST, in addition to GraphQL, for the user facing API
  3. Authorization engine enhancements
  4. HA & Distributed Ops — Reliability & Scalability (aka — prevent GraphQL is the single point of failure related problems)
  5. Metadata API tooling

1. Connecting multiple databases simultaneously and database generalization

  1. Connect to multiple independent databases simultaneously
  2. Database generalization — accelerate Hasura support for additional database engines

1.1 Connecting to multiple databases simultaneously

  1. Multi-tenancy: Different tenants have their data grouped into different Postgres databases. Often this is to enable scaling or to enforce stricter data isolation.
  2. Different workloads: A Postgres database optimized for search might be very provisioned and tuned very differently from a database optimised for timeseries (using say, Timescale) which in turn would be very different from a Postgres database tuned for high transaction volumes. Data is consumed from these different sources together.

1.2 Database generalization

1.3 Remote Joins

  1. Remote Schemas to databases: Join the output of any GraphQL API datasource with a data model
  2. Remote schemas to remote schemas: Join types across different GraphQL services
  3. Database to database: Join across different databases

2. Support REST endpoints, not just GraphQL

  1. Self-serve consumption: API consumers can browse, explore, test and integrate APIs with a much tighter feedback loop without requiring the typical kind of hand written documentation & tooling.
  2. Query what you want: API consumers can craft an API query to get precisely the data they want without requiring humans to build custom endpoints for their favourite shape of data. Imagine a database that served data only in a fixed shape — ridiculous right! And now that’s what we want, but from our APIs too. Performance, caching, security etcetera should Just Work as much as possible.
  1. The lack of GraphQL vendor tooling around GraphQL in production — ops, caching, monitoring, error and QoS reporting, authorization, security are all entirely new with GraphQL. In mission critical scenarios, especially in enterprise environments, the cost of GraphQL adoption might simply be too high.
  2. Consumers who are not building frontend applications (say on a public API, or for developers building other services) might not want to or be able to use GraphQL clients in their code. As humans, they still love GraphQL for the tooling, but actual usage might not be possible
  3. REST APIs are not going away. This means that teams might have to maintain multiple API engines forever to make sure they don’t alienate some API consumers. The cost of maintaining a GraphQL API and simultaneously a REST API is ridiculous. (REST can also be seen as a placeholder here for teams that use gRPC, say).

3. Authorization engine

4. High Availability & Distributed Ops

  1. Automated failover, circuit-breaking and retry logic customized to the upstream datasource’s characteristics. Eg: The postgres primary replica is down!
  2. Upstream source monitoring: Often when API performance slows down, it is hard to isolate whether the source of the problem is the API layer, or the upstream datasource. Eg: API requests are queuing up because the connection pool is saturated.
  1. Creating a data-dictionary of what the underlying data models, their documentation, frequently used columns, recommended query patterns. We’ve already put together a starter kit for building your own data dictionary on top of Hasura here.
  2. Observing security and authorization configuration and rules on the fly. Observing which authorization clauses are actually used by particular requests.
  3. Creating community and org-specific base metadata configurations and sharing them to encourage common standards and best practices.

Summary

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store