
Now that we have our Global Table configured, we’re going to use DynamoDB Streams to replicate all writes from our existing table to our new Global Table.ĭynamoDB Streams is a feature you can enable on your DynamoDB table which gives you a changelog of your DynamoDB table in a time-ordered sequence. Step 2: Streaming updates to our Global Table We have a Global Table set up with instances in both us-east-1 and ap-northeast-1, but they don’t have any items in them. Use the create-global-table command in the AWS CLI to turn your base tables into a global table.Īt the end of this step, our architecture looks as follows:īoth American and Japanese users are still hitting our us-east-1 API and using our original table. Provision your base DynamoDB tables in each of the regions you want.

Set up local dynamodb us east n virginia manual#
CloudFormation doesn’t support Global Tables as a resource, so you’ll need to do a bit of manual work. With CloudFormation, it’s a little trickier.

With Terraform, you can create your DynamoDB Global Table just like any other Terraform resource. The two most popular IaC tools for working with AWS resources are CloudFormation, a service provided by AWS and Terraform, an open-source tool created by Hashicorp. I’m a strong proponent of infrastructure-as-code (IaC). The first step is to create your new Global Table. For the walkthrough, I’ll use my-table for the name of the existing table and my-global-table for the name of the new table.
Set up local dynamodb us east n virginia how to#
In the walkthrough below, I’ll show you how to migrate an existing DynamoDB table to a Global Table.

To make this transition, you’ll need to migrate all items from your existing, single-region table into a new Global Table. To solve this problem, you want to set up a second copy of your architecture in the ap-northeast-1 region in Tokyo: Each read and write from Japan needs to cross the ocean, the Rocky Mountains, and the great state of Nebraska to make it to AWS datacenters in Northern Virginia. This table has served you well, but your users in Japan have been complaining about the latency. Imagine you have an existing DynamoDB table with >1 million items located in the us-east-1 region of AWS. Backgroundīefore we dive into the architecture, let’s set up the situation. It requires some coding, and one of the things on my #awswishlist is that AWS will provide an automatic mechanism to make this migration easy. In this post, we’ll learn how to migrate an existing table to a new Global Table. A Global Table needs to be completely empty during configuration.

There’s one problem with DynamoDB Global Tables - you can’t change an existing table to be a Global Table. This feature allows you to make reads and writes in the region closest to your user - allowing for lower latency - without manually managing cross-region replication. With Global Tables, you can write to a DynamoDB table in one region, and AWS will asynchronously replicate items to the other regions. It provides low-latency reads and writes via HTTP with low maintenance in a way that fits with high-scale applications.Īt re:Invent 2017, AWS announced DynamoDB Global Tables. The principles are still useful whenever you need to make a schema change or migration in your existing table.Īmazon DynamoDB is a fully-managed NoSQL database that’s exploding in popularity. Thus, the advice around migrating to a global table is less useful. Note: Since this article was published, AWS has added the ability to add regions to an existing table.
