Prompt
Best databases for modern serverless applications
Latest observation
For modern serverless applications, the “best” database usually depends on whether you need:
- relational SQL
- document / key-value
- global low-latency
- real-time subscriptions
- simple operational model
- strong consistency / transactions
Here are the strongest options by category.
Top choices
1. AWS DynamoDB
Best for: high-scale serverless apps, predictable latency, event-driven workloads
Pros
- Fully serverless, autoscaling
- Very fast at massive scale
- Excellent with Lambda / API Gateway / EventBridge
- TTL, streams, global tables
Cons
- Data modeling can be awkward
- Limited ad hoc querying
- Not ideal if you need complex joins
Use it when: your app is mostly key-based access patterns and you want minimal ops.
2. Aurora Serverless v2 (PostgreSQL/MySQL)
Best for: relational apps that still want elasticity
Pros
- SQL, joins, constraints, transactions
- Can handle spiky workloads better than traditional RDS
- Good fit for existing relational apps moving to serverless
Cons
- Not as “fully serverless” in spirit as DynamoDB
- Still requires tuning/capacity planning
- Can be overkill for simple serverless backends
Use it when: you need relational integrity, complex queries, or compatibility with SQL-first stacks.
3. Firebase Firestore
Best for: mobile/web apps, rapid development, real-time sync
Pros
- Very easy to start
- Real-time listeners
- Serverless-managed
- Great developer experience for app-centric workloads
Cons
- Query model has limits
- Costs can become unpredictable at scale
- Not ideal for complex relational data
Use it when: you want fast iteration and real-time client sync.
4. Cloudflare D1
Best for: edge/serverless apps with SQLite-style relational data
Pros
- Very simple
- Edge-friendly
- Great for lightweight apps, prototypes, and global delivery
Cons
- Not for heavy transactional or large-scale OLTP workloads
- Feature set is still maturing
Use it when: you want a lightweight relational database near the edge.
5. PlanetScale (MySQL)
Best for: serverless-friendly SQL at scale
Pros
- Great developer experience
- Branching/workflows are excellent
- Scales well
- Good fit for modern app deployment patterns
Cons
- Some MySQL features are constrained depending on setup
- Not always as straightforward for every workload
Use it when: you want MySQL with serverless-friendly operations and strong DX.
6. Supabase Postgres
Best for: startups and modern apps that want Postgres plus auth/storage/realtime
Pros
- PostgreSQL
- Easy to build full-stack apps
- Realtime features
- Strong ecosystem
Cons
- Not as “invisible” operationally as pure serverless databases
- Scaling characteristics depend on deployment
Use it when: you want Postgres with a developer platform around it.
Best by use case
If you want true serverless at scale
- DynamoDB
- Firestore
- D1 for smaller/edge workloads
If you want SQL + serverless
- Aurora Serverless v2
- PlanetScale
- Supabase Postgres
- D1 for lightweight cases
If you need real-time user-facing apps
- Firestore
- Supabase Realtime
- DynamoDB + streams if you build the realtime layer yourself
If you need global low latency
- DynamoDB Global Tables
- Cloudflare D1
- Firestore depending on region design
If you need complex queries and transactions
- Aurora Serverless v2
- Postgres-based options like Supabase or Neon
- Avoid modeling everything in DynamoDB unless access patterns are simple
My practical recommendations
Choose DynamoDB if:
- you’re on AWS
- want minimal ops
- access patterns are known in advance
- scale and latency matter more than SQL flexibility
Choose Aurora Serverless v2 / Postgres if:
- your app needs SQL
- you expect joins, reporting, or transactional logic
- you want easier developer ergonomics than NoSQL
Choose Firestore if:
- you’re building a mobile-first or real-time app
- you want fastest time-to-market
Choose PlanetScale / Supabase / Neon if:
- you want modern Postgres/MySQL for serverless-style development
- you care about developer experience and portability
Quick rule of thumb
- Simple key-value / event-driven / huge scale: DynamoDB
- Relational business app: Postgres/Aurora Serverless v2
- Realtime app: Firestore or Supabase
- Edge-first lightweight app: D1
- Modern SQL with great DX: PlanetScale / Neon / Supabase
If you want, I can also give you:
- a ranked list by cost,
- a ranked list by developer experience, or
- a recommendation for your specific stack (AWS, GCP, Vercel, Cloudflare, etc.).