Working with DynamoDB?

DynamoDB throttling or billing out of control? We sort it out.

DynamoDB rewards access patterns designed up front and punishes teams who treat it like a document database. We find the hot partition, the scan that should be a query, or the on-demand table that would be cheaper on provisioned capacity, and leave the table serving traffic at a cost that matches the actual workload.

  • Since 2015Fixing technology
  • FreeEstimates
  • US teamReal engineers

dynamodb-metrics.log

still broken

What it is

Amazon DynamoDB at a glance

Amazon DynamoDB is a fully managed NoSQL database launched in January 2012, and it is the operational data store behind a large share of AWS-hosted services. Data is organized into tables with a partition key and an optional sort key, and secondary indexes extend the access patterns a table supports.

DynamoDB offers two billing modes, provisioned and on-demand, plus features including DynamoDB Streams for change capture, global tables for multi-region replication, transactions, time-to-live expiry, and DAX for an in-memory cache layer. It fits write-heavy workloads, session stores, event sourcing, serverless backends and anywhere single-digit-millisecond read and write latency matters more than ad-hoc querying.

Type
Managed key-value and document NoSQL database
First released
2012
License
Proprietary AWS service, usage based pricing
Maintained by
Amazon Web Services
Typically used for
Serverless backends, session stores, event sourcing, high-throughput APIs, Lambda-backed applications

The honest version

Amazon DynamoDB pros and cons

No technology is all upside. This is where Amazon DynamoDB earns its place and where it tends to cause trouble.

Where Amazon DynamoDB is strong

  • Predictable single-digit-millisecond latencyReads and writes return in the same ballpark whether the table holds a thousand items or a billion, because the service is partitioned horizontally underneath.
  • No servers to manageNo instances, no patching, no disk resizing. Provisioning is a tier choice, scaling is a configuration change, and the operations cost is close to zero on the infrastructure side.
  • Scales horizontally without downtimeA table that holds a few megabytes at the start of a project can hold terabytes at the end without a migration, because capacity increases happen in the background.
  • Integrates with the AWS ecosystemLambda, API Gateway, AppSync, Kinesis, EventBridge and IAM all have first-class DynamoDB support. A serverless stack reaches for DynamoDB as the default data store for good reason.
  • Streams enable event-driven patternsDynamoDB Streams emit a change record for every write, which composes cleanly with Lambda to run downstream updates, notifications and projections without a message bus in the middle.
  • Global tables for multi-region active-activeA single feature toggle replicates a table across regions with eventual consistency on the write side, which handles disaster recovery and low-latency reads from multiple geographies in one step.

Where Amazon DynamoDB bites

  • Access patterns must be designed up frontA relational database lets you ask any question afterward. DynamoDB forces you to decide which questions the data has to answer before you load it, which rewards good design and punishes guessing.
  • Hot partitions are a real failure modeA single partition key that receives disproportionate traffic throttles that partition regardless of total table capacity. The fix is schema work, not more capacity.
  • Scans are expensive and get expensive fasterA full table scan reads every item and spends capacity on every item read, so a reporting query that works at ten thousand rows costs real money at ten million.
  • On-demand pricing surprises teamsOn-demand is simple and genuinely useful for spiky workloads, but at steady high throughput it costs several times what provisioned would. The bill usually shows the gap only after a quarter.
  • Transactions are not freeDynamoDB transactions exist and work, but they cost twice the capacity of a normal write and have a 100-item limit. They should be reserved for genuinely atomic operations, not routine writes.
  • Querying flexibility has limitsGlobal secondary indexes let you query by more than the primary key, but every index duplicates the data and consumes capacity on every write to the base table. Four indexes is often the point where cost outruns benefit.

Sound familiar?

Common Amazon DynamoDB problems we fix

The Amazon DynamoDB problems that bring people to us, and what you have once each one is fixed.

ProvisionedThroughputExceededException

A provisioned table keeps throttling

A steady workload has grown past the configured RCU or WCU on a table or index, and auto-scaling is lagging behind the spikes. Either capacity needs a floor raise or the access pattern needs rethinking.

Throttling gone, capacity matches demand

HotPartitionKey: 3x average throughput

One partition is burning the capacity

A table where a handful of partition keys receive most of the traffic, usually because the key is a tenant id or a status flag with uneven distribution. More total capacity does not help the hot partition.

Keys distributed across partitions

Billing: on-demand table $4,120 this month

On-demand billing jumped unexpectedly

A workload that was spiky at launch became steady, and on-demand pricing is now billing several times what provisioned would at the same throughput. The billing mode is the wrong fit.

Billing mode matches the traffic shape

ConsumedCapacity: scan consumed 2,400 RCUs

A scan is eating the capacity budget

A reporting query implemented as a Scan, which reads every item in the table regardless of filter, consuming capacity that the live application needs.

Scan replaced with a query or index

ValidationException: Query condition missed key schema element

Query is missing a required key

A Query call that specified the sort key without the partition key, or an index that requires a different key set than the application assumed. Only the partition key is required; the sort key is optional.

Queries use the right key set per index

ItemCollectionSizeLimitExceeded: 10 GB

A single partition has outgrown the limit

A table with a local secondary index cannot hold more than 10 GB of items under one partition key, and a tenant has crossed that line. The schema needs a different key design before more writes land.

Partition layout supports future growth

TransactionCanceledException

Transactions fail intermittently

A transactional write that checks conditions against items another writer modified, or an atomic group that bumps against the 100-item limit, or a transaction that spans a table that was in the middle of a schema change.

Transactions scoped to what they can guarantee

GSI backfill in progress

A new index is slow to backfill

A global secondary index added to a large table that backfills over hours or days, during which queries against the new index return partial results silently.

Index live and consistent across the table

What we do

DynamoDB help, from rescue to steady running

Ring us about one throttling table, or hand over the DynamoDB estate and we tune it end to end.

Rescue
Throttling in production, a hot partition starving the application, or a bill that jumped overnight. We get the table serving traffic and the cost under control.
Access pattern design
Table and index shapes designed from the access patterns that matter, with the trade-offs made explicit rather than discovered later.
Billing review
A line-by-line look at on-demand versus provisioned, index cost, Streams cost and DAX ROI, with the cheapest shape for the actual workload.
Hot partition rescue
Keys reshaped with write sharding, read-through caches where they help, and traffic distribution verified against CloudWatch rather than hoped at.
Migrations
Moves from MongoDB, PostgreSQL or Cassandra onto DynamoDB with a schema that was designed for the destination rather than copied from the source.
Managed Tech
Steady work on capacity reviews, index hygiene, backup verification and CloudWatch alerting, so a hot partition or a billing spike shows up before the on-call phone does.

How it works

From first message to fixed

  1. Look Free estimate

    Tell us what's going wrong. We look at it, then tell you plainly what's wrong and what it will cost.

  2. Fix

    We fix the cause, not the symptom. If something is down, getting it back up comes first.

  3. Harden

    Backups, monitoring, updates and access, so the same problem can't quietly come back.

  4. Hand back or stay on

    You get a plain-language write-up. Or we stay on for hosting, upkeep and new work.

Often found together

Running Amazon DynamoDB alongside something else?

We work on the whole stack, so the problem can be wherever it actually is.

Questions

Amazon DynamoDB questions

Something else? Call+1 737 727 7327

Why is our DynamoDB table throttling if we have capacity available?

Because capacity is per partition, not per table. If one partition key receives a disproportionate share of traffic, DynamoDB throttles requests against that partition no matter how much total capacity the table has. The symptom is ProvisionedThroughputExceededException on a table whose CloudWatch metric shows consumed capacity well under the provisioned level. The fix is almost always to redistribute the keys, not to add more capacity.

Should we use on-demand or provisioned billing?

On-demand is the right choice for traffic that is spiky, unpredictable or in an early launch phase, because you pay only for what you use and auto-scale handles everything. Provisioned becomes cheaper, often by three or four times, once the workload is steady and predictable. We look at the CloudWatch metrics for the last quarter and tell you which mode would have been cheaper, with the numbers to back it.

Why did our DynamoDB bill jump this month?

The common causes are an on-demand table that moved from spiky to steady traffic without anyone switching billing modes, a scan that was always expensive and started running more often, a new global secondary index that doubled the write cost, or data transfer out of the region to a new consumer. We trace every line on the invoice and show which items are worth paying for and which are not.

Can we migrate from MongoDB or PostgreSQL to DynamoDB?

Sometimes, and sometimes the answer is no. DynamoDB does not forgive a schema designed for a relational database, so a straight copy of tables and joins will throttle or scan its way through the capacity budget. We design the DynamoDB shape from the access patterns the application actually has, which usually looks nothing like the source schema, and only recommend the migration when the pattern fits.

Why do our DynamoDB transactions keep cancelling?

Because a transactional write checks conditions against items that another writer has changed, or because the transaction spans items whose combined size exceeds the 4 MB limit, or because a conditional check in the group is simply wrong under concurrent load. We look at the specific TransactionCanceledException reasons, which name the failing condition, and either narrow the transaction or change the conflicting write path.

How much does DynamoDB help cost?

The estimate is free. Describe the table and what the CloudWatch metrics or the bill are telling you, and a quote arrives before any work starts.

Free estimate

DynamoDB giving you trouble?

Tell us what you're running and what's going wrong. A person reads it and comes back with an estimate.

  • No charge to find out what it will take
  • If it's urgent, say so

Replies come from a person. By sending, you authorize us to email you back. No marketing.