Amazon DynamoDB – High Availability and Resilience – SOA-C02 Study Guide

Amazon DynamoDB

DynamoDB is a serverless NoSQL solution that uses a standard HTTPS access model to access table data. A table in DynamoDB is a collection of items that is regionally bound. A table must also have a unique name in the region where it was created. DynamoDB supports storing any amount of data and is distributed and replicated across three or more availability zones in the region. DynamoDB is also scalable and can be autoscaled by default using the AWS AutoScaling service.

The DynamoDB distributed back end allows the performance of each table to linearly scale, but the dataset distribution is what determines if scaling is possible. When you are creating a table, you need to define a primary key. The primary key is used to distribute the data on the back end. You should choose a primary key that has a lot of variety and is known to the application (the application uses it to address data) to get the most performance out of DynamoDB. DynamoDB now also supports ACID transactions.

DynamoDB Global Tables

A DynamoDB global table is a collection of DynamoDB regional tables (called replica tables) that are replicated multidirectionally. To create a global table, you need to first create replica tables in each of the regions where you want to run your application. The replica tables are connected to the global table, and each replica is now subscribed to all other replicas’ changes. All changes are replicated across the globe with a consistency window of one second. A write to one of the tables is replicated across all other regions within one second.

DynamoDB global tables can be used for any application that needs to share data across the global audience or for any application that is distributed across two or more regions nearby. Because the application always works with the local replica, all typical features of DynamoDB are available to the local instances (ACID transactions [reads and writes], batching, standard writes, strongly consistent reads, and eventually consistent reads). Instances can, however, also access the replica tables in the other region(s), but only standard writes and eventually consistent reads are supported in this scenario.

Cram Quiz

Answer these questions. The answers follow the last question. If you cannot answer these questions correctly, consider reading this section again until you can.

1. You have been asked to make an application highly available across us-east-1 and us-west-2 AWS regions. The application currently uses a MySQL RDS Multi-AZ back end. What would be the most cost-effective solution to support the application requirements?

A. Set the Multi-AZ primary replica to us-east-1a AZ and the secondary replica to us-west-2a AZ.

B. Create a read replica of the primary in the other region.

C. Convert the database to Aurora multiregional deployment. Deploy the primary instance in us-east-1a AZ and a secondary instance in us-west-2a AZ.

D. Convert the database to DynamoDB global tables.

2. You have deployed an Aurora database primary instance in availability zone us-east-1a. What steps need to be taken to make the data in the Aurora database highly available?

A. None.

B. Deploy a read replica to us-east-1b.

C. Turn on Multi-AZ.

D. Create a snapshot of the database volume.

Cram Quiz Answers

1. Answer: B is correct. The application can easily be made highly available by creating a read replica in the other region. If the primary region fails, the read replica can be promoted to primary and the application requests redirected to the other region.

2. Answer: A is correct. The Aurora database has a cluster volume that is replicated six times across three availability zones. After a database is created, the volume itself is automatically made highly available. If the single instance fails or the availability zone where the single instance resides is unavailable, a new instance creation is attempted by the Aurora service. However, there is no guarantee that the launch will succeed; this is why in production it is recommended to keep an Aurora read replica instance in another AZ so that it can be quickly promoted to primary in case of failure.

What Next?

If you want more practice on this chapter’s exam objectives before you move on, remember that you can access all of the Cram Quiz questions on the Pearson Test Prep software online. You can also create a custom exam by objective with the Online Practice Test. Note any objective you struggle with and go to that objective’s material in this chapter.