tags
POPULAR

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

17 July, 2019 | 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

Close

Get Started with GraphQL Now

Hasura Cloud gives you a fully managed, production ready GraphQL API as a service to help you build modern apps faster.

Tanmai Gopal

Tanmai Gopal

Tanmai is the co-founder of hasura.io. He is passionate about making it easier to build things.

Read More

Ready to get started?
Start for free on Hasura Cloud or you could contact our sales team for a detailed walk-through on how Hasura may benefit your business.
Get monthly product updates
Sign up for full access to our community highlights, new features, and occasional baby animal gifs! Oh, and we have a strict no-spam rule. ✌️