The automated PITR restoration process introduces a new challenge of data changes during the restoration process that needs to be captured and incorporated to maintain data consistency and avoid data loss.
In this post, we present a solution that automates PITR restoration and handles data changes occurring during the restoration process, providing a smooth transition back to the restored DynamoDB table with near-zero downtime.
Automated PITR solutions provide not just data recovery but also increased business continuity, data integrity, and operational efficiency.
Challenges with alternative solutions including version numbers and optimistic locking include the identification of affected items and data loss issues when deployments change several versions of the same item.
Industries such as e-commerce, content management systems, and IoT data collection systems can benefit from automated PITR solutions.
The solution architecture uses DynamoDB, DynamoDB Streams, AWS Lambda, Amazon SQS, AWS EventBridge and AWS Step Functions.
AWS CDK is used to create an AWS EventBridge, Step Functions state machine, SQS queue, and backfilling functions.
The process consists of the source table serving live traffic, restoration to a timepoint, DynamoDB streams, queuing, and backfilling reproduced changes.
After deploying the solution, PITR restore can be initiated. The process captures and replicates changes in near real-time during the restore process.
Additional future upgrades to the solution include an idempotency layer, incremental changes made to the table and retrieval, and processing of CDC writes once.