Moving an application layer to serverless does not move the database with it. Classic MVC stacks bound together a data tier, an application tier and a presentation tier, and choosing Postgres for the bottom layer was a sound default: robust, fast, ACID-compliant, open-source, over thirty years old, and heavily integrated with the frameworks around it. Those same properties become liabilities when every request runs as its own short-lived execution unit.

Where Postgres Meets Serverless

Postgres assumes a stateful connection. It holds a connection open to avoid paying the network round-trip on every read, which is efficient for a long-running monolith. That number of connections is not unlimited, and it is often fixed when the database is provisioned. In a serverless model each request is effectively a new machine opening a new connection, so held-open connections can exhaust both the connection limit and the machine's memory.

The database is also provisioned ahead of time: its size, the machine capacity, the location and the connection limit are all decided at creation. The application can scale automatically while the database must be watched and scaled by hand — especially painful for traffic spikes that vary in both time and place. Usefully, serverless removes operational overhead from the application layer only to add it back at the database.

The remaining frictions:

  • Security model — the traditional Postgres model allows no client-side use and is vulnerable to SQL injection.
  • Centralization — a globally deployed application still talks to a database pinned to a single location, potentially thousands of miles away.
  • Operational overhead — sharding, distribution and backups return to the team's plate.
  • Execution constraints — stateless, on-demand execution cannot preserve network connections and is slowed by extra dependencies such as ORMs and middleware.

None of this was what Postgres was designed for, and the complexity of forcing it into shape is often enough to make a team abandon serverless altogether.

What an Ideal Database Would Look Like

A database in the spirit of serverless should match the application's automatic, on-demand scale and its global footprint: stateless connections with no limit; auto-scaling for both machine size and database size; secure access from client and server alike for serverless APIs and Jamstack use cases; global distribution; and no operational overhead for sharding, distribution or backups. Leaving Postgres behind also demands parity with it: robust, distributed, ACID transactions, and relational modeling that supports joins over normalized data.

Postgres-Based Options and Their Limits

Amazon Aurora offers a managed Postgres with automatic scalability, backups and some global distribution, but it is not easy to set up, retains operational overhead, and keeps the traditional security model — client access still needs an accompanying API. Hasura puts a GraphQL API over Postgres, resolving client-side security and moving closer to the ease of other serverless services. Its application layer is distributed, but the database is not, and the team still manages the database and an extra security layer.

Schemaless Systems and the Modeling Gap

Azure CosmosDB supports SQL and NoSQL databases under the hood and ships libraries usable on both client and server, avoiding a dependency like Hasura; it brings some global distribution and automatic scale, but many choices remain and database management is not eliminated — size still matters and the database type must be selected. Switching to schemaless designs also changes how data must be modeled to query efficiently, a subtle but large source of friction when leaving Postgres. Fauna claims to close that gap: no database size or underlying type to manage, ACID transactions, global distribution and no data loss, with client and server access and full serverless function support across JAMstack clients, serverless APIs, long-running backends, or combinations thereof. Its document-relational model lets relational principles carry over into collections and indexes rather than demanding a wholly unfamiliar mental model.

Postgres has served as a dependable foundation for application development for more than three decades. As agile, iterative workflows pushed teams toward the serverless model, the expectation shifted: increasingly complex applications with less operational overhead. That expectation extends to the database layer, which is now asked for the same flexibility and ease of management as the rest of the stack. The goal is to keep what makes Postgres valuable — ACID transactions above all — and shed the burdens that come with running it: connection pooling, resource provisioning, security, distribution, and the management of scale, availability and reliability.

Options for a Serverless-Native Data Layer

Several approaches aim to meet that expectation. Amazon's Aurora Serverless v2 delivers a serverless option that operates in this model. Hasura sits on top of such systems to push further toward the serverless promise. Other offerings, including Cosmos DB and Fauna, are not built on Postgres but are designed for serverless while supporting important Postgres functionality.

Trade-offs Among the Alternatives

Cosmos DB offers considerable flexibility in choosing a database, but it still leaves teams with many decisions to make and does not eliminate operational overhead entirely. Fauna takes a different position: it preserves ACID transactions, relational modeling and normalized data while removing the operational overhead of database management. It is a ground-up rethinking of the database rather than an adaptation of an existing one. By combining the strengths of the past with the requirements of the future, Fauna behaves more like a data API — a shape that fits naturally into a serverless future.