loading...
Hasura

How Hasura scales to 1 million active GraphQL subscriptions (live queries)

hasurahq_staff profile image Hasura Originally published at blog.hasura.io on ・1 min read

Hasura is a GraphQL engine on Postgres that provides instant GraphQL APIs with authorization. Hasura allows 'live queries' for clients (over GraphQL subscriptions). For example, a food ordering app can use a live query to show the live-status of an order for a particular user.

We designed hasura to be scalable right out of the gate. We recently tested Hasura's performance to handle a million active live queries. As part of the test setup multiple clients (a web/mobile app) subscribe to data or a live-result with an auth token. The data is in Postgres. 1 million rows are updated in Postgres every second (ensuring a new result pushed per client). Hasura is the GraphQL API provider (with authorization).

The results: At 1 million live queries (and hence 1 million open websocket connections to Hasura), Postgres is under about 28% load with peak number of Postgres connections at around 850.

We've written about the architecture that enables this performance (and some more notes on our benchmarking process and tooling) on our github repo.

Check it out here: https://github.com/hasura/graphql-engine/blob/master/architecture/live-queries.md

Posted on by:

hasurahq_staff profile

Hasura

@hasurahq_staff

⚡️ Instant GraphQL APIs to build realtime apps & APIs. Connect Hasura to your database & other data sources (REST & GraphQL servers, 3rd party APIs) and get a unified data access layer instantly.

Hasura

Hasura GraphQL Engine is an opensource service that gives you instant realtime GraphQL APIs on Postgres with fine grained access control.

Discussion

pic
Editor guide