Serverless edge
Vercel functions → Neon Postgres, with Upstash Redis as a cache. Every function invocation can open a database connection.
What this architecture teaches
Serverless functions scale to hundreds of concurrent instances in seconds. Databases do not: Postgres accepts on the order of 100 connections.
Every concurrent invocation that reaches the database needs a connection, so a modest traffic increase exhausts them. The cache helps, but its misses alone exceed what the database can serve.
This is why serverless stacks use connection poolers (PgBouncer, Neon’s pooler, RDS Proxy) and HTTP-based database drivers.
What to look for
- Functions scale to hundreds of concurrent invocations
- The database has ~100 connections
- This is why serverless apps need connection poolers
Components
- Web users — Web browser (Traffic source)
api — Vercel Functions (Serverless function)
Upstash — Upstash Redis (Cache)
Neon — Neon (Relational DB)