
When to Choose Provisioned Over Amazon DocumentDB Serverless
Part 5 of 5 diving deep in Amazon DocumentDB Serverless through empirical testings
Series: Amazon DocumentDB Serverless: An Empirical Study (5 articles)
- …
- 5When to Choose Provisioned Over Amazon DocumentDB Serverless This article
Amazon DocumentDB Serverless is a good default for many workloads - variable traffic, bursty patterns, dev/test environments, workloads with genuine idle windows. But it is not the right choice for every workload. This closing article walks through the four scenarios where provisioned instances still win, using the empirical findings from Parts 1-4 as the decision inputs. If you have read the previous four articles, this is where the "so what" lands: how to decide between serverless and provisioned for your specific workload.
Who this is for
You have read Parts 1-4 (or you're familiar with the findings). You're at the decision point: serverless or provisioned for this workload? This article gives four decision inputs and the reasoning behind each.
Executive summary
Serverless is the better default. Choose provisioned instead when:
- You need constant sub-2 ms P99 read latency, always. Serverless cache eviction on scale-in produces temporary latency spikes (Part 3) that provisioned instances don't experience.
- You have specific reasons to prefer fixed compute over elastic: predictable per-hour billing, guaranteed cache retention, no scaling loop overhead. These reasons often line up with sustained high throughput (15+ DCU steady 24/7) but do NOT stem from a fundamental serverless throughput ceiling — DocumentDB Serverless supports MaxCapacity up to 256 DCU. See the caveat below on why you should load-test rather than extrapolate from published plateau numbers.
- Your workload is genuinely steady 24/7 with no meaningful quiet windows. Serverless overhead (scale-in/scale-out cycles, cache re-warming, tail-billing) provides no benefit if there's nothing to scale away from.
- You need per-instance cost predictability for chargeback or budgeting. Provisioned instances have fixed hourly cost; serverless bills per-second based on actual DCU used.
For everything else - variable traffic, bursty workloads, dev/test, unpredictable spikes, workloads with quiet windows - serverless is likely the better choice.
How to use this article
This is the synthesis piece. Each decision input below cites the empirical measurement it comes from, without repeating the full methodology. If a claim surprises you, follow the link to the source article for the underlying data.
Decision 1: Latency SLO strictness
Serverless behavior (from Part 3).
- P50 read latency on warm cache at ~10 DCU: 0.68 ms
- P50 read latency on cold cache at 0.5 DCU: 3.14 ms
- Individual first-page-fetch latencies for the first ~300 ms after quiet: 100-180 ms
If your SLO is "P99 read latency < 5 ms including immediately after quiet windows," serverless will not consistently meet it during the ~30 seconds after each scale-in cycle. If your SLO is "P99 read latency < 5 ms at steady state," serverless meets it fine.
Provisioned equivalent behavior. Provisioned instances don't scale down between workload bursts. The buffer cache is never evicted for scaling reasons. Read latency stays at the warm baseline continuously. The compute-bound latency floor is fixed at instance-class capacity.
Decision rule. If your application has quiet windows longer than ~10 minutes AND cannot tolerate a first-request latency spike after each quiet window, provisioned wins. Otherwise, serverless is fine (and much cheaper).
Mitigation for serverless. Two options if you want to stay on serverless but soften cold-cache spikes:
- Pre-warm before opening to traffic. Drive a synthetic warmup workload against the expected working set 30 seconds before real traffic arrives.
- Set MinCapacity high enough that the working set stays resident. Per Part 4's Rule 2, size MinCap to
working_set_GB / 2. If your working set is 20 GB, MinCap 10 keeps it in cache and eliminates the cold-cache issue. But you pay for that 10 DCU always - which is when provisioned becomes competitive on cost.
Decision 2: Sustained throughput level
Serverless behavior (from Parts 2 and 4).
- DCU ≈ throughput / 200 at steady state
- On our specific test setup (
t4g.xlargeclient running 300 PyMongo threads on a small-doc insert workload), aggregate throughput plateaued at ~1,750-2,000 ops/sec around DCU 15-18
- We did not isolate where the bottleneck lived (cluster side, or client-side CPU/GIL/socket/network limits). DocumentDB Serverless itself supports MaxCapacity up to 256 DCU; a different client setup or workload profile may plateau at very different points
If your application sustains 3,000 ops/sec continuously, you're running at max single-instance serverless capacity 24/7. At that point serverless is doing no scaling work - the elastic capacity is fully consumed.
Provisioned equivalent behavior. A
db.r8g.xlarge (4 vCPU, 32 GB RAM) offers fixed compute and predictable pricing regardless of scaling behavior. Larger instances (r8g.2xlarge, r8g.4xlarge, up to r8g.16xlarge) scale from there. Multi-instance provisioned clusters extend further. Whether provisioned actually beats serverless on cost at a given throughput level requires running the pricing math — DocumentDB Serverless supports MaxCapacity up to 256 DCU and may serve your workload well past our test's plateau point.Decision rule. For workloads at sustained high throughput, don't extrapolate from our observed plateau (which was likely constrained by our test client, not the cluster). Instead:
- < 8 DCU steady state: Serverless is a fine default. Room to scale down during quiet windows, cost-effective steady-state pricing.
- 8-15 DCU steady state: Do the cost math both ways. Serverless with a matching MinCap floor vs. provisioned r8g.xlarge or r8g.2xlarge. Also consider quiet windows (serverless wins) vs. genuine 24/7 (provisioned may win on cost predictability).
- > 15 DCU steady state: Load-test both configurations with your actual workload before deciding. Provisioned may be more cost-effective and provides predictable pricing, but serverless has significantly more headroom than our tests explored (MaxCapacity up to 256 DCU). Don't assume serverless "can't handle" your throughput based on our test's plateau — measure it.
Where to look up costs. The AWS DocumentDB pricing page has current per-DCU and per-instance prices. Database Savings Plans reduce provisioned r8g cost by up to 20% for a 1-year commitment - factor this in if you're comparing at higher throughputs.
Decision 3: Traffic pattern (variability vs. steadiness)
Serverless behavior. Serverless earns its cost savings during quiet windows. If your workload has 4 hours of peak traffic and 20 hours of idle per day, serverless scales down during the 20 hours and you pay only for peak-hour DCU. If your workload runs at ~5 DCU steady 24/7, serverless still bills for that steady-state, no savings vs. a fixed-cost provisioned instance of matching capacity.
Provisioned behavior. You pay for the instance-class hourly cost 24/7, regardless of utilization. This is a benefit if your workload is genuinely steady (no wasted overhead from unnecessary scaling loops). It's a cost overhead if your workload has meaningful quiet windows.
Decision rule. Ask: "In a 24-hour window, how many hours does my workload spend at less than 30% of peak throughput?"
- < 4 hours: Workload is effectively steady. Provisioned may be more cost-effective.
- 4-8 hours: Borderline. Do the DCU math both ways.
- > 8 hours: Serverless wins - you're getting real scale-down time that provisioned would waste.
Dev/test workloads almost always fall in the > 8 hours category (nights and weekends idle). Dev/test is where serverless most reliably beats provisioned.
Decision 4: Cost predictability requirements
Serverless behavior. Cost varies per-second based on actual DCU. A workload with variable traffic has a variable bill. This is efficient when you want to pay for what you use, but it makes month-over-month budget forecasting harder.
Provisioned behavior. Fixed hourly cost per instance. Bill is deterministic (barring storage growth). This is easier to chargeback to teams, compare against reserved capacity, and budget for.
Decision rule. If your organization requires deterministic monthly costs (e.g., strict chargeback models, government/regulated environments with fixed budget lines), provisioned is easier to operationalize. If you can absorb variable bills within a monthly range, serverless usually saves money on average.
Middle ground. MaxCapacity in serverless creates a cost ceiling. Set it to the DCU equivalent of your budget cap, and you get variable pricing with a hard upper bound. This is the closest serverless equivalent to a fixed-cost operating envelope.
Decision matrix
Workload characteristic | Serverless | Provisioned |
|---|---|---|
Variable/bursty traffic | ✅ | |
Steady 24/7 traffic > 15 DCU | | ✅ |
Latency SLO < 5 ms P99 always | (needs high MinCap) | ✅ |
Latency SLO < 5 ms P99 at steady state | ✅ | ✅ |
Dev/test with quiet windows | ✅ | |
Fixed budget requirement | (with MaxCap) | ✅ |
Fastest possible response to spikes | ✅ (~5 sec) | ✅ (already scaled) |
Cache-warm on first-request | (needs high MinCap or pre-warm) | ✅ |
Working set > 20 GB with strict latency | (needs MinCap ≥ 10) | ✅ |
What we didn't cover
- Multi-instance provisioned scaling. Provisioned instances can be added to a cluster to scale read throughput beyond single-instance. Whether this changes the serverless comparison for read-heavy workloads is beyond the scope of this study.
- Database Savings Plans math. DBSP applies to provisioned r7g and r8g families with commitments of 1-year no-upfront. The exact break-even DCU count depends on your Savings Plan discount rate; check the DocumentDB pricing page for current rates.
- Serverless-plus-provisioned hybrid architectures. Some customers run provisioned writers with serverless read replicas for a compromise. We didn't measure this hybrid pattern.
Summary of the series
Five findings across five articles:
- Part 1: DocumentDB Serverless responds to CPU, IOPS, and memory pressure. Connection count is not a scaling signal. Idle connections above 500 pin DCU above floor.
- Part 2: Scale-out reaches 90% of achievable throughput in ~5 seconds regardless of MinCapacity floor. Scale-in takes 10-17 minutes. Sustained low workload right-sizes DCU (throughput/200).
- Part 3: Scale-in evicts the buffer cache. First reads after quiet show 100-180 ms individual page-fetch latencies for ~300 ms. Scale-out does not accelerate in-flight queries.
- Part 4: MinCapacity should be sized as
max(connection_floor, cache_floor, throughput_floor). Connection floor: 250 PyMongo clients per DCU. Cache floor: ~2 GB per DCU. Throughput floor: ops/sec / 200.
- Part 5: Serverless is the better default. Choose provisioned for strict latency SLOs with quiet windows, sustained throughput > 15 DCU, genuinely steady 24/7 workloads, or hard budget requirements.
Next steps
- Consider whether serverless fits your workload based on the four decision inputs above.
- Evaluate is a two-way door. You can start by adding a serverless read-replica to an existing cluster and observe:
-
ServerlessDatabaseCapacity- DCU trajectory over time
-
DatabaseConnections- peak concurrent connections
-
BufferCacheHitRatio- is it staying above 95%?
-
ReadLatency/WriteLatency- does it meet your target?
- Use the reproducer. Every finding is reproducible from the companion GitHub repository . Clone the repo and modify the relevant phase script to test against your workload pattern or your driver.
- Contact your AWS account team for migration guidance and cost sizing specific to your workload.
Previously in this series
Reproducibility. All 15 experiments, raw JSON results, and Python driver scripts are in the companion GitHub repository .
Feedback welcome via the GitHub issues page on the reproducer repo.
Series: Amazon DocumentDB Serverless: An Empirical Study (5 articles)
- …
- 5When to Choose Provisioned Over Amazon DocumentDB Serverless This article
Enjoyed reading this content? Let the author know!
Your likes, comments, shares, and saves help creators reach more builders.
Loading recommendations
Loading article