Shanaka
Shanaka

Reputation: 83

Accessing Data while updating the same data on AWS DynamoDB

I am planning to build a mini Content Management System. Checking the possibility of storing the Content on a DynamoDB, Will the services be able to access the content while Updating the same content? (Scenario of updating the content on CMS and publishing) Or CloudSearch will be the better solution instead of DynamoDB in such use case?

Thanks in advance!

Upvotes: 1

Views: 798

Answers (1)

notionquest
notionquest

Reputation: 39186

Please think about your use case and decide whether it requires eventually consistent read or strongly consistent read.

Read Consistency

Eventually Consistent Reads

When you read data from a DynamoDB table, the response might not reflect the results of a recently completed write operation. The response might include some stale data. If you repeat your read request after a short time, the response should return the latest data.

Strongly Consistent Reads

When you request a strongly consistent read, DynamoDB returns a response with the most up-to-date data, reflecting the updates from all prior write operations that were successful. A strongly consistent read might not be available in the case of a network delay or outage.

Note:-

DynamoDB uses eventually consistent reads, unless you specify otherwise. Read operations (such as GetItem, Query, and Scan) provide a ConsistentRead parameter: If you set this parameter to true, DynamoDB will use strongly consistent reads during the operation.

AWS DynamoDB tool (Java) for transaction management:-

Out of the box, DynamoDB provides two of the four ACID properties: Consistency and Durability. Within a single item, you also get Atomicity and Isolation, but when your application needs to involve multiple items you lose those properties. Sometimes that's good enough, but many applications, especially distributed applications, would appreciate some of that Atomicity and Isolation as well. Fortunately, DynamoDB provides the tools (especially optimistic concurrency control) so that an application can achieve these properties and have full ACID transactions.

You can use this tool if you are using Java or AWS SDK Java for DynamoDB. I am not sure whether similar tool is available for other languages.

One of the features available on this library is Isolated Reads.

Isolated reads: Read operations to multiple items are not interfered with by other transactions.

Dynamodb transaction library for Java

Transaction design

Upvotes: 1

Related Questions