February 03, 2025

Prisma Postgres: The Future of Serverless Databases

Prisma Postgres is the database for developers—and it’s finally ready for production! Built on Cloudflare, unikernels, and bare metal infrastructure, it enables a unique set of benefits like zero cold starts, global caching, real-time events, and a lot more!

Prisma Postgres is ready for production 🎉

Prisma Postgres is built on a unique technology stack, based on unikernels and Cloudflare infrastructure. Here are the main features and benefits this enables:

  • Zero cold starts: Instant access to your database without delays.
  • Generous free tier: 100k operations, 1GiB storage per month & 10 databases.
  • Global caching layer: Query responses are easily cached at the edge.
  • Built-in connection pool: Scale your app without worrying about TCP connections.
  • Real-time events: Event delivery with at least once and same order guarantees.
  • Performance tips: AI-powered recommendations for speeding up your queries.
  • Simple pay-as-you-go pricing: Predictable costs based on operations & storage.

Try it now by following the Quickstart or simply run this command in your terminal:

The serverless database that's built for the future

Prisma Postgres has been designed from first principles and with the developer in mind. No more complicated setup flows or database configurations—set up your Prisma Postgres instance and start querying in a minute.

Serverless—but without cold starts

Serverless databases are awesome because of their pay-as-as-you go pricing models that only incur costs when the database is used. However, one downside of this approach is that, once a database was scaled down to zero, it needs to be "woken up" again. This wake-up process is known as cold start and can cause serious delays for your users.

Prisma Postgres is the first serverless database without cold starts thanks to its innovative architecture and milli-second cloud stack running on bare metal machines.

For free: 100k operations, 1GiB storage & 10 databases

Experimenting with a new technology, building prototypes, or working on hobby projects shouldn't cost you any money! Prisma Postgres provides a generous free tier that lets you kick off any project without worrying about costs.

This is possible because Prisma Postgres is based on unikernels (think: "hyper-specialized operating systems") running as ultra-lightweight microVMs. These unikernels are extremely efficient and allow to run thousands of database instances on a single machine.

As a user, this means you can create an up to ten databases per workspace for free to play around and build small projects with. You also get 100k operations and 1GiB storage that you can use to hack around without worrying about cost.

Simple & predictable: Pricing anyone can understand

Pricing for Prisma Postgres is different than for other database providers. Unlike traditional pricing models, it charges for number of database operations and GiB storage, not for upfront resource allocation, compute hours or egress.

An operation is counted each time you do a create, read, update or delete with Prisma ORM against your Prisma Postgres instance.

With this kind of pricing model, one of the first concerns developers typically have is: How to prevent an enormous, surprise bill in case there's a lot of unforeseen traffic"? Short answer: You can put spend limits in place in order to control your budget and avoid excessive costs.

Our goal is to make pricing substantially more simple than other providers. This pricing model lets you predict your usage and reason about cost more easily based on the actual traffic your application will see. With traditional pricing, the burden of scaling is on you: If you have low-traffic periods, and high-traffic periods (like most production apps) then you either under-provision and risk having downtime in busy periods, or you over-provision and pay a lot more for your database.

With Prisma Postgres' usage-based pricing, you truly pay only for what you need!

Serve data from a global cache close to your users

One major benefit of Prisma Postgres is that you can configure database caching on a per-query level. Database results are then cached at the edge and will be served to your application from a close, physical location.

Here's how easy it is to configure a cache strategy, just add the cacheStrategy option with ttl and/or swr options:

The ttl (Time-To-Live) and swr (Stale-While-Revalidate) options indicate to Prisma Postgres how long the currently cached data should be considered fresh and whether an update of the cache should happen in the background. Prisma Postgres' cache also supports advanced use cases like on-demand cache invalidation.

You can learn more about different caching strategies and their use cases in our docs.

Scale effortlessly with built-in connection pooling

A connection pool is a crucial component if you want to scale your application and have it respond to your users' requests in a timely and efficient manner. The reason is that the creation of database connections is an expensive operation, so you want to avoid having to re-open new connections frequently (or in the worst case, for every new user request).

This is especially important if your app is deployed via serverless or edge functions, where it's not possible to keep database connections open due to the ephemeral nature of these environments. The consequence is that your application is going to fail during traffic spikes when the number of requests exceeds the number of available connections:

Prisma Postgres' built-in connection pool helps you prevent these failure scenarios and deal with traffic spikes without any extra effort! It also prevents query delays due to the need of establishing new connections because connections are opened once and will be reused upon future requests.

Real-time events with delivery guarantees via CDC

In addition to the built-in cache and and connection pool, Prisma Postgres also comes with a fully-fledged Change Data Capture (CDC) service that that enables you to build complex, event-driven systems by reacting in to changes that happen in your database.

You can use it to sync data into a search index, build real-time features (such as messaging or notifications) or interactive, collaboration tools.

Subscribing to these change events can be done in a single line of code:

The stream() method returns an async iterator that will be invoked any time an event happens in the database. Here's an example snippet for how the events from this stream can be consumed:

Note that you can also easily filter for specific events, for example only events for created records or events that fulfil a certain filter condition:

The events are delivered to any subscribed application instances in real-time via WebSockets.

Another nice feature of Prisma Postgres' event system is that it can provide delivery guarantees for the database change events:

  • At least once: An event is delivered one or more times, ensuring it never goes undelivered.
  • Same order: Events are delivered in the exact order as they were produced.

First-class integration with Prisma ORM

Prisma ORM is the most popular ORM in the Node.js and TypeScript ecosystem. Developers love it for the human-readable schema, automated migrations and type-safe queries.

Here is an example of how you model your data with Prisma ORM:

Prisma ORM then translates this schema into a SQL migration and updates the schema in your database. Once the tables are created, you can read and write data with Prisma ORM's intuitive query API:

Prisma Postgres is designed to work seamlessly with Prisma ORM, leveraging its tightly integrated connection pool for optimal performance and scalability. While direct TCP connections for other ORMs aren't currently available, we're actively working on expanding compatibility in the future. If you want to use query editors or other tooling, you can use our local TCP tunnel to interact with Prisma Postgres outside of the ORM.

Netlify, Vercel & IDX: Try one of our integrations

Prisma Postgres is available via a Netlify extension which allows you to easily connect your Prisma Postgres instance with a Netlify site. If you're curious, you can follow our tutorial to deploy a Next.js site with Prisma Postgres to Netlify.

An integration for Vercel Marketplace is coming soon. In the meantime, you can check out our official Next.js 15 with Prisma Postgres example.

We've also collaborated with the folks from Google's Project IDX, an amazing online IDE, and created a template so you can try Prisma Postgres without leaving your browser. It'll be live very soon!

Built on next-generation infrastructure

Let's talk about the underlying technology that enables these unique benefits and features.

The first database running on unikernels

We're very excited about advancements in the unikernel technology that is behind Prisma Postgres! Unikernels are "specialized operating systems" with only the resources they actually need to run an application:

Unikernels have been around for a while and we have observed them as an emerging technology trend for a long time. As we started our collaboration with Unikraft—a company that's pioneering the unikernel landscape—we found that they're finally ready for high-performance production workloads! So we decided to build Prisma Postgres on top of them.

Unikernels are famous for providing excellent performance in terms of boot times, throughput and memory consumption, to name a few metrics.

Unikraft: Fast, Specialized Unikernels the Easy Way (Research paper, EuroSys 21)

Together with Unikraft, we were able to reduce the Prisma Postgres binary image to less than 20% of the size of the original PostgreSQL image, making the Prisma Postgres architecture even more efficient.

These specialized binary images are deployed as unikernels on our own bare metal machines; and, as unikernels are ultimately virtual machines, each PostgreSQL instance provides strong, hardware-level isolation.

Caching & event layers built on Cloudflare

At Prisma, we're huge fans of Cloudflare and strong believers that it'll leave a major mark on the cloud computing landscape. That's why we've built the Prisma Postgres caching and real-time event layers on top of the global Cloudflare infrastructure.

The cache is implemented via Cloudflare Workers (so it caches data at the edge) and uses the official Cloudflare Caching API. The event layer that's implementing the Change Data Capture service is built on Cloudflare Workers and Durable Objects.

If you're curious about the details of the Prisma Postgres technology stack and how it works under the hood, stay tuned this week on the Prisma blog for our upcoming technical deep dive: Cloudflare, Unikernels & Bare Metal: Life of a Prisma Postgres Query.

We're just getting started!

The official General Availability launch of Prisma Postgres today is a major milestone for us as a company! We are incredibly grateful for the strong support, valuable feedback and overall excitement shared by our community in the past months. Without all of you, we would not have been able to bring Prisma Postgres to this point. Thank you 💚

But we are not stopping here: Get ready for some more exciting announcements in the next weeks.

Also, this week we'll continue sharing amazing news and resources about Prisma Postgres every day!

We'd also love to see you during our livestream on Friday, 10am ET | 4pm CET. We're going to explore what you can build with Prisma Postgres and have an engineer join us for a technical deep dive.

Let us know what features you'd like to see us add to Prisma Postgres next: Reach out to us on X and LinkedIn, subscribe to our YouTube channel, and join our Discord.


Try Prisma Postgres

Don’t miss the next post!

Sign up for the Prisma Newsletter