In Amazon DynamoDB,
Read/Write Capacity Modes determine
how twtech pays for throughput and how DynamoDB
allocates resources to serve its reads and writes attributes.
There are two main modes (plus an optional
on-demand backup/restore & autoscaling layer... it can add on top):
1. Provisioned Capacity Mode
twtech explicitly configures
how many read and write units it wants for the table (or GSI).
Best for predictable
workloads.
- Read Capacity Units (RCUs) → 1 strongly consistent read per second for an item up
to 4 KB, or 2 eventually consistent reads per second for 4 KB.
- Write Capacity Units (WCUs) → 1 write per second for an item up to 1 KB.
- Auto Scaling (optional) → DynamoDB can automatically adjust RCUs/WCUs based on
load.
- Over-provision risk
→ twtech might pay for unused capacity if traffic is lower than expected.
- Under-provision risk
→ twtech may get throttled if requests exceed provisioned RCUs/WCUs.
When to use: Predictable traffic
patterns, steady baseline with occasional spikes handled by auto scaling.
2. On-Demand Capacity Mode
twtech doesn’t predefine
RCUs/WCUs. DynamoDB instantly accommodates the workload.
Best for unpredictable or new workloads.
- twtech pay per request:
- Read request units (RRUs)
- Write request units (WRUs)
- Instantly scales up and down with traffic.
- No throttling (except in rare, extreme, sustained
spikes).
- No need to manage capacity settings.
- Typically more expensive at high sustained
throughput than provisioned.
When to use: Unpredictable traffic, new
apps without a baseline, or dev/test workloads.
Key Differences Table
Feature |
Provisioned Capacity |
On-Demand Capacity |
Billing model. |
Pay per RCU/WCU provisioned per
hour |
Pay per request (RRU/WRU) |
Scaling. |
Manual or auto-scaling |
Fully automatic |
Best for. |
Predictable workloads |
Unpredictable workloads |
Throttling. |
Possible if exceed provision |
Rare; only on extreme spikes |
Price predictability. |
High (fixed hourly rate) |
Variable (depends on requests) |
Insights:
twtech can switch between modes once every 24 hours per table (but GSIs
follow the table’s mode). Also, a table’s mode applies to all indexes on it.
A diagram to show the difference between Provisioned and On-Demand DynamoDB capacity modes … how reads/writes are handled.
1. Predictable
Traffic Pattern 1. Unpredictable
Traffic Pattern
(steady or forecastable) (spiky, unknown, new app)
2. Set
Capacity: 2. No
Capacity Setting:
- RCUs = N
(e.g., 100) - DynamoDB
scales instantly
- WCUs = M (e.g., 50) - Pay per request
3. Request
Flow: 3. Request
Flow:
Key takeaway:
Provisioned mode - has a fixed throughput meter — once it’s full, extra requests get throttled unless you’ve set auto-scaling.
On-Demand mode - is like a stretchy pipeline that adjusts instantly to the flow, billing per
operation.
No comments:
Post a Comment