Need advice about which tool to choose?Ask the StackShare community!

Hasura

332
630
+ 1
144
Prisma

1.1K
951
+ 1
54
Add tool

Hasura vs Prisma: What are the differences?

Introduction

In this comparison, we will outline the key differences between Hasura and Prisma, two popular tools used for backend development with databases. Both Hasura and Prisma provide features to simplify and enhance the development of APIs, but they have different approaches and specialties.

  1. Real-time capabilities: Hasura is known for its real-time capabilities, allowing developers to build real-time applications with ease. It provides instant GraphQL APIs on existing databases, enabling real-time updates and subscriptions out of the box. Prisma, on the other hand, has limited real-time capabilities and focuses more on database modeling, schema management, and data relations.

  2. Database support: Hasura is designed to work with PostgreSQL databases, and it leverages the advanced features provided by PostgreSQL to enable real-time updates and queries. Prisma, on the other hand, supports various databases including PostgreSQL, MySQL, SQLite, and SQL Server, providing more flexibility in terms of database choices.

  3. Development workflow: Hasura provides a powerful GraphQL engine that automatically generates a GraphQL API based on the existing database schema. This makes it easy for developers to get started quickly without writing GraphQL resolvers. Prisma, on the other hand, adopts a more code-first approach where developers define the data models using the Prisma schema language and generate the database schema and CRUD operations based on the defined models.

  4. Authentication and authorization: Hasura offers built-in authentication and authorization features, allowing developers to secure their APIs and control access to data. It supports various authentication providers and role-based access control (RBAC) policies out of the box. Prisma, on the other hand, focuses more on data modeling and does not provide native authentication and authorization features. However, Prisma can be integrated with other authentication and authorization systems to secure the APIs.

  5. Custom business logic: Hasura provides support for custom business logic through event triggers and serverless functions. Developers can define event triggers on database changes and execute serverless functions in response to those triggers. This allows developers to add custom business logic without modifying the existing database schema. Prisma, on the other hand, does not offer built-in support for event triggers or serverless functions. Custom business logic needs to be implemented separately.

  6. Community and ecosystem: Hasura has gained a lot of popularity and has a vibrant community behind it. It provides extensive documentation, tutorials, and examples to help developers get started quickly. Prisma also has an active community but is comparatively newer. It provides comprehensive documentation and tooling to support developers, but its ecosystem is still growing.

In summary, while both Hasura and Prisma provide powerful features for backend development, they have different specialties. Hasura excels in real-time capabilities, database support, and provides an easy development workflow, while Prisma focuses more on database modeling, schema management, and has a more flexible ecosystem for different databases.

Manage your open source components, licenses, and vulnerabilities
Learn More
Pros of Hasura
Pros of Prisma
  • 23
    Fast
  • 18
    Easy GraphQL subscriptions
  • 16
    Easy setup of relationships and permissions
  • 15
    Automatically generates your GraphQL schema
  • 15
    Minimal learning curve
  • 13
    No back-end code required
  • 13
    Works with new and existing databases
  • 12
    Instant production ready GraphQL
  • 11
    Great UX
  • 4
    Low usage of resources
  • 4
    Simple
  • 12
    Type-safe database access
  • 10
    Open Source
  • 8
    Auto-generated query builder
  • 6
    Supports multible database systems
  • 6
    Increases confidence during development
  • 4
    Built specifically for Postgres and TypeScript
  • 4
    Productive application development
  • 2
    Supports multible RDBMSs
  • 2
    Robust migrations system

Sign up to add or upvote prosMake informed product decisions

Cons of Hasura
Cons of Prisma
  • 3
    Cumbersome validations
  • 2
    Doesn't support downward/back migrations
  • 1
    Doesn't support JSONB
  • 1
    Do not support JSONB
  • 1
    Mutation of JSON is really confusing
  • 1
    Do not support JSONB

Sign up to add or upvote consMake informed product decisions