CloudVectra Logo CloudVectra
CloudVectra Knowledge Hub

AWS DynamoDB vs. Azure Cosmos DB: Architecture, Partitioning, Performance and Pricing

Compare NoSQL partitioning, request units, capacity modes, indexes, consistency and global replication with practical DynamoDB and Cosmos DB calculations.

7 min read

NoSQL cost problems often start with access patterns rather than instance size. A table can have plenty of aggregate capacity while one partition receives nearly all requests. A small result set can still require a large distributed scan.

DynamoDB and Cosmos DB both provide managed distributed data services, but their partitioning, consistency and consumption units differ. This guide compares DynamoDB with Cosmos DB for NoSQL using RU-based capacity, not every Cosmos API or separately priced vCore product.

Monetary examples use illustrative USD assumptions; capacity calculations identify the relevant service rules. Validate current mode, region and feature eligibility.

1. Data models and access paths

DynamoDB supports key-value and document-style items. A table’s partition key, optional sort key and secondary indexes define efficient access paths. Cosmos DB for NoSQL stores JSON items in containers, with an item identifier and partition key forming the efficient point-read address.

Flexible documents do not remove data modeling. List the required queries, tenant sizes, write rates, ordering, uniqueness and transaction boundaries before choosing a key.

RequirementDynamoDB design questionCosmos DB design question
Fetch one entityIs the primary key known?Are item ID and partition key known?
Fetch related recordsCan a Query use partition/sort keys or an index?Can the query target one logical partition?
Spread writesDoes the key distribute current traffic?Does the partition key distribute RU demand?
Atomic workDoes the operation fit supported transaction limits?Does it fit the supported transactional scope?
Additional query shapeIs another index/materialized access path needed?What index and partition fan-out does it require?

2. Partition keys determine usable scale

A low-cardinality key such as country or status can concentrate traffic. A timestamp prefix can send every current write to one key. A high-cardinality key can still be hot when one tenant dominates.

Adding random suffixes can spread load but requires multiple reads to reconstruct an aggregate. Time buckets bound growth but can make current buckets hot. Hierarchical keys or synthetic keys have service-specific capabilities and migration implications.

Partition diagram contrasting evenly distributed aggregate demand with a hot partition that limits usable throughput.

For a conceptual four-partition deployment, assume each partition can serve 1,000 units/second. A 2,000-unit workload with 1,800 units targeting one partition still overloads that partition. The 2,200 units of unused aggregate headroom elsewhere do not automatically solve that key’s pressure.

That is a teaching model, not a statement of either provider’s exact partition limit. Measure per-key/per-partition behavior and consider documented adaptive capacity, splitting and key constraints.

3. DynamoDB requests and provisioned capacity

On-demand capacity bills eligible read/write request units. Provisioned capacity purchases throughput per second, with autoscaling and reserved-capacity options where applicable. Provisioned units are a rate; they are not a monthly count of requests.

For individual item reads, DynamoDB rounds size in 4 KB increments. Strongly consistent reads use one read unit per increment; eventual reads use half, and transactional reads use twice the strong-read amount. Writes use 1 KB increments for ordinary item operations, with transaction and operation-specific rules. See DynamoDB capacity calculations.

For 100,000 separate reads of 5 KB items:

Size increments per read = ceil(5 / 4) = 2
Strongly consistent read units = 100,000 × 2 = 200,000
Eventually consistent read units = 100,000 × 2 × 0.5 = 100,000

For 100,000 ordinary writes of 1.2 KB items, the size-rounded quantity is 200,000 write units before index and replication effects. Batch and query aggregation rules differ; do not assume all APIs round a combined payload identically.

A filter applied after reading does not refund the work used to examine items. A scan returning ten rows can still consume substantial read capacity.

4. Cosmos DB RUs are not DynamoDB units

Cosmos DB expresses operation work in request units. Item size, indexing, query complexity and consistency affect consumption. A small point read is not equivalent to a cross-partition query returning the same item.

Manual provisioned RU/s, autoscale maximum RU/s and consumed-RU serverless are different purchasing models. Review hourly peak/floor rules, regional configuration and eligible features. See request-unit guidance.

Suppose diagnostics show a point-oriented request consumes 5 RUs while an alternative fan-out query consumes 250 RUs. At 100,000 calls, those designs consume 500,000 versus 25 million RUs, a 50-fold difference.

At an illustrative consumed-RU price of $0.25/million, that is $0.125 versus $6.25 for the specified operations. In provisioned mode, the immediate bill instead depends on purchased throughput and capacity thresholds. Fewer RUs can create headroom before they enable a smaller paid allocation.

5. Indexes and storage amplify writes

DynamoDB secondary indexes add storage and relevant write/read consumption. Global secondary indexes have separate access and consistency behavior; strong reads are not supported on GSIs. Project only fields the access pattern needs, while accounting for additional base-table reads when required.

Cosmos indexing policy controls the indexed paths and query support. Indexing every property can add unnecessary storage/write work, but excluding needed paths can worsen queries. Benchmark both write RU and representative reads before changing policy.

Large embedded arrays and repeatedly rewritten documents can increase cost in both services. Splitting an entity into smaller items can reduce some operations while adding reads, joins in the application, or transaction complexity.

6. Consistency is a correctness decision

DynamoDB offers eventual and strong reads on eligible regional access paths, with separate transaction semantics. Global tables now support multi-Region eventual consistency (MREC) and multi-Region strong consistency (MRSC), with different availability, region and feature constraints.

Cosmos DB offers strong, bounded staleness, session, consistent prefix and eventual consistency. These are not five pricing presets interchangeable with DynamoDB settings. Stronger requirements can increase coordination, latency and consumption or constrain topology. See Cosmos consistency levels.

Define the invariant: inventory cannot be oversold, a user must see their write, or a report may lag. Use the weakest model that satisfies that invariant with correct application handling, rather than choosing eventual consistency solely because it appears cheaper.

7. Global replication: avoid outdated transfer assumptions

DynamoDB global tables bill replicated writes in each full replica region, plus storage, reads and applicable indexes. AWS currently states that global-table replication does not incur cross-region data-transfer fees. An MRSC witness is not a full replica and has separate billing treatment. See global-table billing.

That exception does not make every cross-region export or application transfer free. Use the actual path and operation.

Cosmos multi-region deployments add region-specific throughput/storage costs and applicable replication/data-transfer meters. Multi-write configuration and consistency affect eligible topology and total cost. Do not copy DynamoDB’s exception into a Cosmos estimate.

8. TTL, backups and change processing

DynamoDB TTL expiration is asynchronous, so expired data can remain until background deletion. Applications needing immediate expiration must enforce that logic. The initial TTL deletion does not consume write throughput, but replicated TTL deletes can create charges in eligible global-table configurations. Verify feature support for the selected consistency mode.

TTL is not a backup policy. Configure PITR or backup retention and test restore behavior separately. A regional replica can propagate accidental deletion.

DynamoDB Streams and Cosmos change feed support downstream processing with their own consumers, checkpoints and costs. Cosmos latest-version change feed is not a complete historical deletion log; other feed modes have prerequisites. Check change-feed behavior before using it for audit or recovery.

9. Diagnose consumption before increasing capacity

Track consumed units, throttles, per-partition/key distribution, item sizes, index growth, query fan-out and successful operation latency. A retry storm can increase requests while hiding the original hotspot.

Compare cost per successful business operation along with total spend. A workload can consume fewer units per request and still cost more after growth or another region is added.

CloudVectra cost analysis supports service spending and trend comparisons. Cost Centers and anomaly detection add ownership and investigation context. Use database diagnostics to identify the partition or query responsible.

Continue the database series

Sources and further reading

Choose whether CloudVectra may load optional analytics. You can change this at any time.

Cookie names, providers, and retention