Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is DynamoDB still following CAP theorem with its "Strong Consistency" promises?

Previously, DynamoDB was providing "eventual consistency" only, obeying "Availability" and "Partition Tolerance" portion of CAP theorem.

But now, DynamoDB provides "strong consistency" option apart from the "eventual consistency". Does that mean DynamoDB is not following CAP theorem?

like image 956
Neeraj Gupta Avatar asked Sep 06 '15 18:09

Neeraj Gupta


People also ask

Does DynamoDB support strong consistency?

DynamoDB supports eventually consistent and strongly consistent reads. When you read data from a DynamoDB table, the response might not reflect the results of a recently completed write operation.

Is CAP theorem still valid?

Despite advancements and rethought algorithms such as partially-synchronous models, CAP theorem remains relevant today.

Is DynamoDB Theorem the CAP?

Strong Consistency with High Availability In terms of the CAP theorem, DynamoDB is an Available & Partition-tolerant (AP) database with eventual write consistency. On the read front, it supports both eventually consistent and strongly consistent reads.

How does DynamoDB achieve strong consistency?

Strong Consistency While the DynamoDB table supports strongly consistent reading, it results after all mutations have been fully activated. Therefore, this model will guarantee the return of the most updated data. The process behind this behavior is by locking down the physical nodes as they update.


1 Answers

DynamoDB, in strongly consistent mode, trades against availability:

When you issue a strongly consistent read request, DynamoDB returns a response with the most up-to-date data that reflects updates by all prior related write operations to which DynamoDB returned a successful response. A strongly consistent read might be less available in the case of a network delay or outage. For the GetItem, Query or Scan operations, you can request a strongly consistent read result by specifying optional parameters in your request.

Thus, it violates no theoretical constraints.

like image 171
Charles Duffy Avatar answered Oct 21 '22 07:10

Charles Duffy