Our pricing for Prisma Postgres indeed presents a bit of a mental shift compared to traditional database providers:
We charge for query volume, not for compute!
We believe that ultimately this is a more intuitive way for developers to think about database cost.
Generally, our goal is that developers need to only think about _queries_ — we'll take care of everything else to make sure those queries can run efficiently. Developers shouldn't need to worry about compute, scaling, downtime, etc.
How about the scenario where I do a select … where … on a view and that view is defined to have 5 CTEs on different tables and then a final select doing some complex stuff there.
That would be billed as a single query. We think this is a much simpler way to reason about your cost compared to counting rows scanned, CPU time consumed or something more granular like that.
If your query is very expensive, it will take longer to complete, and that will be a signal to you the developer to simplify your query or identify an index that can help speed it up. Prisma Optimise will help you identify and improve such queries.
While I think as an arm-chair business wonk y’all should count it as 6 queries and not 1 as a payer and consumer I’m even more likely to use it now that you count us as only a single query. :-)
I just answered the same questions on Twitter [1], so just quoting that:
Neon is a lot more feature-rich right now (since PPG just came out) and has awesome stuff like branching.
On the long-run, we expect to have a similar feature set. Additionally, our underlying tech has the benefits of avoiding cold starts and likely being more cost-effective.
That being said, I see it as a major benefit that with Prisma you not only get a DB but an entire data layer (incl global caching and real-time DB events) thanks to the first-class integration of our other products like Accelerate and Pulse [2].
Nikolas from Prisma here! I've been around for almost 8 years (since the Graphcool days) and this description is pretty accurate but I can add a bit more color. The major product evolutions we've had were:
- Graphcool: A GraphQL BaaS written in Scala.
- Prisma 1 (see [1]): A GraphQL proxy server between DB and app server. This was essentially the "GraphQL engine" of Graphcool that we ripped out and made it available as an open-source component. However, its auto-generated CRUD GraphQL API never was meant to be consumed by a frontend. Instead, it was the abstraction layer for the app server to interact with the DB (at first only for GraphQL APIs on the app server via `prisma-binding`, then the first version of Prisma Client that worked with any API layer — both of these were thin JS/TS layers that talked to the GraphQL proxy server where the actual DB queries were generated).
- Prisma 2+ aka Prisma ORM (see [3]): We realized that with Prisma 1, we were essentially competing with ORMs but that our architecture was way too complex (devs needed to stand up and manage an entire server where other ORMs could be used with a simple `npm install`). So, we rewrote the Scala "DB-to-GraphQL" engine in Rust to be able to provision it via a download during `npm install` and run it as a sidecar process on the app server, added a migration system and Prisma ORM was born. That being said, it has evolved a lot since then. We dropped GraphQL in favor of a way more efficient wire protocol [4] and have continuously reduced the footprint and responsibility of the query engine (e.g. you can now use Prisma ORM with standard Node.js DB drivers [5]).
If you want more details, I talked more about this evolution on Twitter [6] a while ago.
This launch is a huge milestone for us and it's definitely one of the most exciting launches I've been a part of at Prisma!
If you're already looking at Next.js + Tailwind but unsure about what to use for the DB, I'd recommend checking out the T3 stack [1].
It uses tRPC [2] for type-safe API calls and Prisma [3] for your DB. There's lots of content out there teaching how to use this stack to build sophisticated apps (e.g. this in-depth tutorial teaching how to build a social media app [4]).
Disclaimer: I work at Prisma and am also a huge fan of type-safety, so T3 is basically my dream stack.
The Playground is an interactive learning environment for Prisma. Learn how to send database queries and explore migrations workflows with the Prisma ORM.
Hey there, I'm Nikolas from the Prisma team. Just came here to quickly clarify this notion:
> Prisma is an API server that puts a GraphQL API in front of a DB.
Prisma is an ORM which generates a JavaScript/TypeScript client library for your database.
Your description is very true for Prisma 1 (which has been in maintenance mode for several years and is officially deprecated by now [1]), but the latest version(s) of Prisma (v2+) don't expose a GraphQL API any more. Prisma 1 also used GraphQL SDL for data modeling, the Prisma ORM on the other hand has its own, custom modeling language for describing database schemas in a declarative way and also comes with a flexible migration system.
That being said (and as Jens also mentioned elsewhere), the Prisma ORM does use GraphQL _internally_ as a wire protocol. However, as a developer, you _never_ touch this internal GraphQL layer and are not even supposed to be aware of it (you actually have to jump through a lot of hoops to even "find" it). It's also very likely that we'll replace GraphQL as a wire protocol in the future, so "GraphQL" really isn't something you should be thinking about as a developer who is using Prisma.
Hope that clarifies the situation a bit, let me know if you have any further questions around this topic.
Is there any post which goes into evolution of prisma from initial days of exposing graphql API directly to using it as wire protocol in the query engine?
And now the likely removal of graphql as wire protocol. What are the key reasons to remove the use of graphql query language?
> Is there any post which goes into evolution of prisma from initial days of exposing graphql API directly to using it as wire protocol in the query engine?
To be honest, I think the most comprehensive resource for this is a Twitter thread [1] that I posted from my personal account that explains the different turns we took in the product direction :D
Otherwise, there's yhr blog post "How Prisma & GraphQL fit together" [2] that also touches on the same topics but might be a bit dated since it was published before we released the Prisma ORM for production use.
> And now the likely removal of graphql as wire protocol. What are the key reasons to remove the use of graphql query language?
The short answer is that it would allow us to make us more optimizations for the bridge between JS- and Rust-land in Prisma Client. However, this is not an urgent issue for us at the moment so very likely won't become a priority in the near/mid-term future.
> 4. All the GraphQL Backend-as-a-Service like Prisma, Hasura etc...
Just wanted to quickly drop in to clarify that Prisma is not a GraphQL-as-a-Service tool any more but an ORM that gives you a type-safe JavsScript/TypeScript client for your DB and a migration tool. The main differences between Prisma 1 and the Prisma ORM (i.e. Prisma 2+) are explained here: https://www.prisma.io/docs/guides/upgrade-guides/upgrade-fro...
You see how hard it is to change perceptions? This is why people spend so much time on branding for developer tools, databases, and infrastructure companies.
Hey there, I work at Prisma — awesome to hear it's been serving you well!
Since you mentioned NestJS, I just wanted to quickly plug a comprehensive tutorial that we've published today that explains how build a REST API with NestJS, Prisma, Swagger and PostgreSQL. I think it gives a really nice overview of the main workflows and best practices when using these tools together!
Thanks for everything Nikolas, you and your team at Prisma has been very supportive and helpful in both GitHub and slack. Your cloud editor has also served our team very well.
We charge for query volume, not for compute!
We believe that ultimately this is a more intuitive way for developers to think about database cost.
Generally, our goal is that developers need to only think about _queries_ — we'll take care of everything else to make sure those queries can run efficiently. Developers shouldn't need to worry about compute, scaling, downtime, etc.
reply