Hasura logo

Hasura

Instant GraphQL on databases

Visit Hasura →

About Hasura

Hasura is an open-source engine that generates production-ready GraphQL and REST APIs instantly from your database schema—no code required. Point Hasura at PostgreSQL, MySQL, SQL Server, MongoDB, or other supported databases, and it automatically creates comprehensive APIs with queries, mutations, real-time subscriptions, and authorization rules based on your schema. Unlike traditional API development requiring custom backend code for every endpoint, Hasura introspects your database and provides powerful querying capabilities out-of-the-box. Teams using Hasura ship features 10x faster by eliminating API boilerplate and focusing on business logic. Hasura's metadata-driven architecture enables declarative authorization, event triggers, remote schemas (federated GraphQL), and scheduled triggers—all configurable through UI or version-controlled YAML.

Best For:
Hasura excels for rapid API development and teams wanting to skip backend boilerplate. It's ideal for startups building MVPs quickly (functional GraphQL API in minutes, not weeks), applications requiring real-time data (subscriptions for live dashboards, notifications, collaborative features), teams with existing databases (instant GraphQL API over legacy PostgreSQL/MySQL), JAMstack applications needing backend APIs (Next.js, React, Vue), mobile applications requiring flexible querying (request exactly the data you need), and developer platforms requiring multi-tenant authorization (row-level security based on JWT claims). Hasura is particularly valuable when your API logic is primarily CRUD operations with authorization rules, not complex business logic requiring custom code.

Common Questions

Does Hasura replace my backend entirely?
Hasura handles CRUD operations, authorization, and real-time data automatically—often 80-90% of typical backend work. For custom business logic (payment processing, complex calculations, third-party integrations), you write "Actions" (custom resolvers calling serverless functions or microservices) or "Event Triggers" (database events triggering webhook endpoints). Pattern: Hasura handles data access, authorization, real-time; your code handles domain-specific logic. This hybrid approach gives you rapid development without sacrificing flexibility.

Hasura vs. traditional REST API frameworks (Express, FastAPI): which to use?
Use Hasura when your API is primarily database CRUD operations with authorization. Use traditional frameworks when you need complete control, complex business logic in every endpoint, or non-database-centric operations. Hasura auto-generates optimized queries, handles real-time subscriptions, and provides declarative authorization—avoiding hand-coded controllers, ORMs, and authorization middleware. Traditional frameworks give unlimited flexibility but require more code. Many teams use both: Hasura for database APIs, custom services for business logic (federated via Hasura Remote Schemas).

How does Hasura perform at scale?
Hasura compiles GraphQL queries into optimized SQL, avoiding N+1 query problems and over-fetching. It uses connection pooling, query batching, and can scale horizontally (multiple Hasura instances). Performance is comparable to hand-optimized SQL queries. Hasura Cloud adds query response caching, CDN integration, and global edge deployment. Organizations process billions of requests/day through Hasura. However, extremely complex queries or massive joins may require hand-optimized SQL or materialized views—Hasura isn't magic, just highly optimized code generation.

Is Hasura vendor lock-in?
Hasura is open source (Apache 2.0), so you can self-host forever. Metadata is stored as version-controlled YAML/JSON, enabling GitOps workflows. You can migrate away from Hasura (your data stays in your database), though you'd need to reimplement the GraphQL API. Hasura Cloud adds conveniences (hosting, monitoring, caching) but isn't required. Less lock-in than proprietary BaaS platforms (Firebase, Amplify) since your data lives in standard PostgreSQL/MySQL, not proprietary database.

Pricing & Plans

Hasura Community Edition (Free, Open Source): Complete GraphQL engine with unlimited projects, queries, real-time subscriptions, authorization, event triggers, remote schemas, scheduled triggers. Self-host on any infrastructure (Docker, Kubernetes, cloud VMs). Free forever under Apache 2.0 license.

Hasura Cloud (Managed Hosting):

  • Free Tier: 1 project, 3 GB data transfer/month, 60 minutes query time/month. Good for prototyping and small apps.
  • Professional: $99/month per project. Includes 100 GB data transfer, 10,000 query minutes, query response caching, metrics & logging, email support. Production-ready for most applications.
  • Enterprise: Custom pricing. Adds multi-region, VPC peering, SSO, advanced security, 99.99% SLA, dedicated support. Typically $500-5,000+/month based on scale.

Additional Cloud Costs:

  • Extra data transfer: $0.20/GB
  • Extra query minutes: $0.02/minute
  • Observability add-on: $49/month (distributed tracing, analytics)

Self-Hosting Costs: Infrastructure only (Docker container runs anywhere). Minimal resource requirements—2 GB RAM, 2 vCPU sufficient for most apps. Postgres database required (can use managed Postgres from AWS, GCP, DigitalOcean). Expect $10-100/month depending on scale.

Limitations

Hasura works best for database-centric applications—if your API is 50%+ custom business logic not tied to database operations, traditional frameworks may be better. Complex computed fields or transforms require custom resolvers (Actions), adding complexity. Hasura's authorization is powerful but role-based and declarative—extremely dynamic authorization logic may be harder to express than imperative code. While Hasura supports multiple databases, each has varying feature support (PostgreSQL gets most love; MySQL/SQL Server lag in features). Hasura generates many indexes and foreign keys for optimal GraphQL performance—existing databases may need schema adjustments. Learning curve: understanding GraphQL, Hasura's metadata model, and authorization system requires time investment. Hasura Cloud pricing can escalate for high-traffic applications (though self-hosting is free).

Getting Started

Quick Start (Docker):
Create docker-compose.yml:

services:
  postgres:
    image: postgres:15
    environment:
      POSTGRES_PASSWORD: secret
  hasura:
    image: hasura/graphql-engine:latest
    ports:
      - "8080:8080"
    environment:
      HASURA_GRAPHQL_DATABASE_URL: postgres://postgres:secret@postgres:5432/postgres
      HASURA_GRAPHQL_ENABLE_CONSOLE: "true"
      HASURA_GRAPHQL_ADMIN_SECRET: myadminsecret

Run: docker-compose up -d. Access console: http://localhost:8080 (admin secret: myadminsecret).

Create table and API:

  1. In Hasura Console, go to Data → Create Table
  2. Create users table with columns: id (UUID), email (Text), name (Text)
  3. GraphQL API is instantly available!

Query your API:

# Insert user (mutation)
mutation {
  insert_users_one(object: {email: "alice@example.com", name: "Alice"}) {
    id
    email
  }
}

# Query users
query {
  users {
    id
    email
    name
  }
}

# Real-time subscription
subscription {
  users {
    id
    email
    name
  }
}

From your app (JavaScript example):

import { ApolloClient, InMemoryCache, gql } from '@apollo/client';

const client = new ApolloClient({
  uri: 'http://localhost:8080/v1/graphql',
  cache: new InMemoryCache(),
});

// Query
const { data } = await client.query({
  query: gql`{ users { id email name } }`
});

Configure permissions in Hasura Console (Permissions tab) for row-level security. Use JWT authentication or webhook auth. Add Actions for custom business logic. Enable Event Triggers for async workflows. Use Remote Schemas to federate multiple GraphQL APIs. Version control metadata: hasura metadata export. Follow Hasura documentation and Learn tutorial for comprehensive training.

Best For

Developers wanting instant APIs

✅ Pros

  • +Instant GraphQL
  • +Real-time
  • +Authorization

❌ Cons

  • -Postgres only
  • -Complex for beginners

Quick Info

Pricing
freemium
Starting at
$0/mo
Share:

Stay in the loop

Get weekly picks of the best no-code tools — straight to your inbox.

Frequently Asked Questions about Hasura

What is the pricing for Hasura?

Hasura offers a freemium pricing model, starting at 0/month.

What category does Hasura belong to?

Hasura belongs to the API Connectors, Database Tools categories.

What are the best alternatives to Hasura?

Check out our api connectors category to discover the best alternatives to Hasura.