REST API with DynamoDB Integration
Understand API Gateway integration with DynamoDB.
Atomic counter
Every architect dreams of an independent distributed system where all transactions process independently of the others. Such ideals remain ideals. Despite all the care, we do end up with scenarios where we need some shared resources like counters. An atomic counter is required in many applications. We need a way to count events and assign a unique number to events while ensuring we do not have a race condition.
Note: Atomicity on a distributed, eventually consistent database may seem counterintuitive, but we can make it work with a trick. We can configure the DynamoDB updates to return the updated value immediately. So, the update may take time to propagate within the database. However, the API invoking the update gets the updated value without conflict. AWS documentation ...
Create a free account to view this lesson.
By signing up, you agree to Educative's Terms of Service and Privacy Policy