Hi, everyone, and welcome back.
Now in today's video, we are going to discuss about the Dynamo DDB Global Tables.
Now at a high level overview, the Global Tables feature in Dynamo DB provides us with a fully managed,
multi region, multi active database that delivers fast local read and write performance for massively
scaled global applications.
Now there are a lot of organisations that have global users.
Users are coming from different continents all together and if you have a dynamo table only in one specific
regions, the US and you have great amount of users coming from different continents, maybe Asia,
maybe Australia and so on.
Then there will be some kind of a latency that would be involved.
So more of a global audience, you can make use of a global table.
So what happens here?
You have multiple Dynamo DB tables in a replication state.
So you see you have a replica in America, replica in Europe, replica in Asia, and the users can be
directed across one among them.
And this can also lower the overall latency.
So before we go ahead and try it out practically, let's understand the basic terminology.
So a global table is a collection of one or more replica tables, all owned by a single second.
Second is a replica table, is a single dynamo table that functions as part of the global table, and
each replica stores the same set of data items.
And third point is when an application writes the data to replica table in one region, Dynamo B propagates
the right to the other replica tables in other regions automatically.
All right.
So this is something that we already discussed in the first slide in this diagram.
So let's go ahead and try it out practically.
Now, currently I am in the Dynamo DB console.
Let's quickly create a new table.
Let's just call it as demo global table the partition key.
I'll just say user ID and we'll go ahead and create a table.
Let's refresh this.
Our table is active.
Let's open this up and within here you have a tab associated with global tables.
Let's open this.
And within here what you need to do, you have to create a replica.
So let's click here and it will ask you in which region you want to create a replica into.
So since this table is created in Mumbai region and this seems to be sufficient for the traffic based
on Asia, so what I'll do, I'll also create a new global table in a different region and the region,
let's say not Virginia.
Here I'll create a replica.
So the status is in creating and note that it can take again.
If it is an empty table, it can take a minute or two for the replica to be created.
So if I refresh, you see our replication region of North Virginia is now active.
Now, let's quickly go to the North Virginia region as well.
And with India, you see the demo global table is available.
In fact, let's go back to the tables in North Virginia region.
You see a demo global table is available and if you go to the global tables this time, it will give
the replication region of Mumbai again.
One important thing to note is that each replica will have a different end point.
So if you look into the endpoint of which in a region it is Dynamo DB dot US East one, but for the
Mumbai region it is Dynamo DB dot AB South one.
So this is one important part to remember.
The second important thing, let's go ahead and try to add some data to see if it is getting replicated.
So I'll quickly create a new item.
The item number is zero one.
Let's go ahead and add a new string.
I'll say name and the name would be else.
Once this is, then I'll quickly create item and what we'll be doing.
This item we had created from Mumbai region, so from North Virginia region, I'll also create one item.
The user ID would be zero two and the name would be Beau.
I'll go ahead and I'll create the item.
All right.
So let's start from the Mumbai region.
We'll do an explore table items here.
I'll click on Run.
And as expected, we are seeing both the list as well as the bomb.
Similarly from the North Virginia region, if I click on exploitable table items, I'll do a run again.
We are seeing both the Alice and Bob.
All right.
So I hope that this you understood the importance of the global table feature.
Now before we conclude a few important pointers to remember, first one is that in a global table,
a newly written item is usually propagated to all the replica tables within seconds seconds with a global
table, each replica table stores the same set of data items.
Dynamo would be does not support partial replications of only some of the items.
This is again quite important.
And third is in case if a conflict can arise, if an application updates the same item in different
region at about the same time, and to ensure that you have an eventual consistency, dynamo would be
global.
Table uses the last writer wince based approach.
So whoever writes the last data, that data would be taken into consideration grade with this base set.
Let's do one thing.
Let's also go ahead and delete our table so that we do not really get charged.
So from the Mumbai region, global tables, you can also go ahead and delete the replica from your,
let's say, delete.
And if you go to North Virginia region, let's refresh the status updating.
Let's refresh once more.
Now the status is deleting.
And once we refresh again, our table is now removed.
And going back to the region, if you refresh, the status is still in deleting.
So let's quickly wait for a moment here.
So let's quickly refresh the page once more.
And our replica is no longer present.
So now even the table in Mumbai region, let's go ahead and quickly delete it.
Great.
So that's the high level overview of global tables and with this will conclude today's video.