liveBook · Manning

Consistency

As explained in Amazon Web Services in Action, Third Edition: An in-depth guide to AWS

A strongly consistent read is a database read that returns the most recent successfully completed write for the requested data.

A strongly consistent read returns the most recent successfully completed write for the requested data. DynamoDB reads are eventually consistent by default, so a read immediately after an update can return an older version. section 12.4.6

Set ConsistentRead to true to request strongly consistent results from getItem, query, or scan. This option improves freshness but takes longer and consumes more read capacity than an eventually consistent read. section 12.4.6

Comparing DynamoDB read requests

An AWS CLI get-item request without --consistent-read consumes 0.5 capacity units in the example; adding --consistent-read consumes 1.0 unit. A strongly consistent getItem for an item up to 4 KB requires one read capacity unit. section 12.11.1

Global secondary indexes are always eventually consistent because table-to-index synchronization is asynchronous. Strong consistency therefore cannot be used to obtain fresh reads from such an index. section 12.4.6 section 12.15

How Amazon Web Services in Action, Third Edition: An in-depth guide to AWS covers it

How deep it goes
Explains stale reads, request configuration, supported operations, capacity cost, and global-secondary-index limitations.
Examples
Demonstrates AWS CLI get-item requests with and without --consistent-read and contrasts their consumed capacity.
What it assumes
Assumes basic familiarity with DynamoDB reads and items while defining eventual and strong consistency from first principles.
What you can do after
Apply it via DynamoDB request options to choose fresh reads while accounting for latency and read-capacity costs.
How it connects
Connects eventual consistency with DynamoDB read operations, read capacity units, global secondary indexes, and transactions.

Also explained in

Compare how 20 books explain consistency →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Amazon Web Services in Action, Third Edition: An in-depth guide to AWS. The section links point to the parts of the book it draws on.