Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Prisma and Hasura are very different!

Prisma is a database toolkit that's used by application developers to develop server-side applications in Node.js and TypeScript (e.g. REST APIs, microservices, gRPC calls, GraphQL APIs, ..., anything that talks to a database). The main tool Prisma Client is a query builder that's used to programmatically send queries to a database from Node.js/TS.

Hasura is a "GraphQL-as-a-Service" provider that generates a GraphQL API for your database. This GraphQL API is typically accessed by frontend developers. That setup can be great when your application doesn't require a lot of business logic and the CRUD capabilities that are exposed in the GraphQL API fit your needs (though I believe you can add business logic in Hasura by integrating serverless functions).

With Prisma, you're still in full control of your own backend application and can choose whatever tech stack you like for developing it (as long as it's Node.js-based, though Prisma Client will be in available in more languages the future)!

By the way, we also love GraphQL. We're currently brewing a new "GraphQL application framework" that can be used on top of Prisma. That way it will be possible to auto-generate resolvers for Prisma models to reduce the boilerplate you need to write, while still keeping the full control of your GraphQL schema.

You can learn more about this here: https://www.nexusjs.org/



> That setup can be great when your application doesn’t require a lot of business logic and the CRUD capabilities that are exposed in the GraphQL API fit your needs (though I believe you can add business logic in Hasura by integrating serverless functions).

(I’m from Hasura)

You can extend business logic in Hasura in a number of ways, including (but not exclusively) ones that work well with serverless and async architectures. Other examples follow:

1. You can extend it by adding business logic in the database via user-defined functions. Eg: You want a fulltext search or a PostGIS function that is better off in the DB anyway.

2. You can bring your own GraphQL server with custom resolvers and Hasura will merge them into its own API and let you “join” across them as well.

3. You can bring REST APIs and add graphql types for them in Hasura and use it as custom resolvers that extend the schema as well.

Hasura’s key value add is an instant GraphQL API backed by your own data-sources (database, GraphQL, REST) and then a fine-grained authorization system on it.

Like Nikolas said, very different from Prisma. Hasura aims to add value as “infrastructure” by guaranteeing performance and security where as Prisma is like an ORM/database toolkit.


Thanks a lot for the clarification, Tirumarai! (Remote JOINs look awesome btw, congrats on the release :)


I love both Prisma 2 and Hasura! 2 awesome products!


It's my impression that hasura caters more to (also) those that need to integrate with an existing database and schema, possibly with views and functions - would that be accurate?

Does it make sense to slap prisma on top of an existing g production database?


(I'm from Hasura).

It was a definitely a design goal for us to make the existing production database use-cases as seamless as possible.

Instead of adding a new DSL on top of the database, Hasura maps much of the DML subset of SQL over to GraphQL (tables, views, functions) so that we're not re-inventing that bit and the translation is restricted to the "relation set" to "tree" transformation. json aggregation and json operations in Postgres are phenomenal! Hasura's authz RLS-like layer injects authorization in as well to make that GraphQL API actually useful.

JOOQ has probably done the most phenomenal job in mapping almost all database constructs to a native language library, but there's a solid amount of type magic there which I'm not sure is portable to every language.


> but there's a solid amount of type magic there which I'm not sure is portable to every language.

It is, but I've just been too lazy so far to actually do it.


It certainly make ssense to use Prisma with an existing database. In fact, Prisma is able to introspect your database and create a typesafe data access client for you.

If you give it a try and have a database handy, I bet you can have it up and running in less than 10 minutes.


Thank you both for replies (hasura and prisma).

Regarding prisma, I see my impression was off a bit from talking with our team that used prisma in a green field project with migrations quite happily. And I somehow forgot that migrations are still marked experimental and are kind of new.

https://www.prisma.io/docs/reference/tools-and-interfaces/pr...


What do you think of Hasura vs Postgraphile?

https://www.graphile.org/postgraphile/


Got it. Thank you both for your replies!


I knew someone was gonna mention Hasura here. What a stupid idea to have API mapped to DB one to one, then solve "the problem" of not being able to write custom logic by inventing some shit (Hasura action). I reckon the reason Prisma pivoted to ORM-alternative was that you realised how wrong such an idea was?

PostGraphile at least has the decency to acknowledge it in their docs[1] and suggest putting logic inside the database (not some "action" nonsense), which is an actual practice, albeit most don't like it. And they don't specifically tell you to hook client directly to the damn generated API!

[1] https://www.graphile.org/postgraphile/evaluating




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: