Overview
Hasura is an open-source GraphQL engine designed to provide instant, real-time GraphQL APIs over new or existing data sources. It automates the process of creating a GraphQL layer by connecting directly to databases like PostgreSQL, MySQL, SQL Server, and MongoDB, as well as REST APIs and other data sources via its Remote Schemas and Data Connectors features. This capability allows developers to query and mutate data using GraphQL without writing custom API code.
The platform is optimized for scenarios requiring rapid API development, such as building real-time applications, internal tools, and microservices architectures. Hasura generates a production-ready GraphQL API with built-in features like filtering, pagination, sorting, and aggregation, directly from the database schema. It also includes a robust authorization system that allows for granular access control based on roles and session variables, ensuring data security at the API level as detailed in the authorization documentation.
Hasura provides both a self-hosted GraphQL Engine and a managed service, Hasura Cloud. Hasura Cloud offers a fully managed, globally distributed GraphQL API service, abstracting infrastructure concerns and providing features like caching, query performance monitoring, and automatic scaling. The self-hosted GraphQL Engine allows for deployment on any cloud provider or on-premises infrastructure, offering flexibility for specific deployment requirements. The developer experience is enhanced by a console that provides a graphical user interface for schema management, data exploration, and API testing, streamlining the development workflow.
Hasura's approach to API development aligns with principles of microservices architecture by enabling independent data services to expose GraphQL APIs that can then be composed into a unified graph. This facilitates decoupling and independent evolution of services, which is a common requirement in large-scale applications. Its real-time capabilities, powered by GraphQL subscriptions, support use cases like live dashboards, chat applications, and collaborative tools by pushing data updates to clients as they occur.
Key features
- Instant GraphQL APIs: Automatically generates GraphQL APIs from existing databases (PostgreSQL, MySQL, SQL Server, MongoDB, CockroachDB, Amazon Aurora, Google Cloud SQL) with minimal configuration.
- Real-time Capabilities: Supports GraphQL subscriptions for real-time data updates, enabling live dashboards, chat applications, and collaborative features.
- Data Federation: Allows combining multiple data sources (databases, REST APIs, other GraphQL services) into a single, unified GraphQL API using Remote Schemas and Data Connectors as described in Hasura's data federation guide.
- Declarative Authorization: Provides a role-based authorization system with granular access control rules defined directly on the GraphQL schema, integrated with authentication providers.
- Caching: Offers built-in caching mechanisms to improve query performance and reduce database load, particularly for frequently accessed data.
- Event Triggers: Enables real-time event-driven architectures by triggering webhooks or serverless functions on database events (insert, update, delete).
- Actions and Remote Schemas: Extends the GraphQL API with custom business logic via Actions (REST/microservice integration) and integrates third-party GraphQL services via Remote Schemas.
- Performance Monitoring: Hasura Cloud includes tools for monitoring query performance, identifying bottlenecks, and optimizing API responses.
- Schema Migrations: Manages database schema changes and tracks them as migrations, facilitating collaborative development and deployment pipelines.
- Console GUI: A web-based console provides a graphical interface for schema management, data exploration, API testing, and configuration.
Pricing
As of May 2026, Hasura offers a free tier and several paid plans for its managed Hasura Cloud service, in addition to the self-hostable open-source engine. Custom pricing is available for enterprise requirements.
| Plan | Description | Monthly Price | Key Features |
|---|---|---|---|
| Free | For personal projects and experimenting with Hasura Cloud. | $0 | 1 project, 30-minute sleep after inactivity, limited API requests. |
| Standard | For production applications with moderate usage. | Starts at $15 | Always-on, 2 projects, 500k API requests/month, 2GB data transfer, 1GB cache, standard support. |
| Professional | For growing applications requiring higher scale and dedicated resources. | Custom | Dedicated CPUs/RAM, 10M API requests/month, 10GB data transfer, 5GB cache, priority support, advanced monitoring. |
| Enterprise | For large-scale, mission-critical applications with advanced security and compliance needs. | Custom | Custom resource allocation, unlimited API requests, advanced security features, premium support, dedicated account manager, compliance features. |
For detailed and up-to-date pricing information, refer to the official Hasura pricing page.
Common integrations
- Databases: PostgreSQL, MySQL, SQL Server, MongoDB, CockroachDB, Amazon Aurora, Google Cloud SQL. Hasura connects directly to these databases to generate GraphQL APIs via Data Connectors.
- Authentication Providers: Integrates with popular identity providers like Auth0, Firebase Auth, AWS Cognito, and custom JWT servers for user authentication as documented in the authentication guide.
- Serverless Functions: Can trigger serverless functions (e.g., AWS Lambda, Google Cloud Functions, Azure Functions) via Event Triggers or use them as Actions for custom business logic.
- REST APIs: Existing REST endpoints can be integrated into the GraphQL schema using Actions, allowing for a unified API experience.
- Other GraphQL Services: Combines external GraphQL services into a single Hasura GraphQL API using Remote Schemas.
- Monitoring & Logging: Integrates with monitoring tools and logging services for observability, especially in Hasura Cloud.
- CI/CD Pipelines: Supports integration into continuous integration and deployment workflows using its CLI for schema migrations and project management.
Alternatives
- Apollo GraphQL: A suite of tools for building, managing, and consuming GraphQL APIs, including client-side libraries, server frameworks, and a managed platform for graph operations.
- PostGraphile: An open-source tool that creates an instant GraphQL API from a PostgreSQL database, focusing on convention over configuration.
- StepZen: A GraphQL API platform that allows developers to build GraphQL APIs by composing data from various sources using a declarative approach.
Getting started
To get started with Hasura, you can deploy a new project on Hasura Cloud and connect it to a PostgreSQL database. The following steps outline how to connect to a new or existing database and create your first table using the Hasura Console.
First, sign up for a Hasura Cloud account and create a new project. Once your project is provisioned, you'll be redirected to the project dashboard. From there, click on the "Launch Console" button.
Inside the Hasura Console, navigate to the Data tab. Here, you can connect to a new database or use an existing one. For a quick start, you can use the "Connect Database" option and select a free Heroku Postgres database or provide credentials for your own PostgreSQL instance.
Once connected, you can create a new table. For example, to create a simple authors table:
CREATE TABLE public.authors (
id serial PRIMARY KEY,
name text NOTnULL,
email text UNIQUE
);
After creating the table, Hasura will automatically track it and generate the corresponding GraphQL schema. You can then navigate to the API tab in the Hasura Console and use the GraphiQL interface to test your GraphQL API. For instance, to insert an author:
mutation InsertAuthor {
insert_authors_one(object: {name: "Jane Doe", email: "[email protected]"}) {
id
name
email
}
}
To query the authors:
query GetAuthors {
authors {
id
name
email
}
}
These examples demonstrate basic GraphQL operations. For more advanced features like relationships, permissions, and event triggers, refer to the Hasura documentation.