A deep dive into the architecture behind Prisma Postgres, tracing the full lifecycle of a query through its technology stack. The journey covers: Prisma ORM sending a lightweight HTTP/JSON request (no local query engine needed), Cloudflare Workers handling authentication and cache routing, a global edge caching layer using TTL and stale-while-revalidate strategies, a connection pool on VMs that generates SQL and manages TCP connections, and finally unikernel-based PostgreSQL instances running on bare metal via Unikraft Cloud and Firecracker VMM. Key innovations include zero cold starts via in-memory VM snapshotting, sub-millisecond wake times, and a future plan to co-locate the connection pool with database instances to eliminate network hops entirely.

11m read timeFrom prisma.io
Post cover image
Table of contents
Recap: What is Prisma Postgres?Life of a Prisma Postgres queryWhat's next for the Prisma Postgres architecture?Conclusion