{"id":2267,"date":"2019-08-22T11:24:02","date_gmt":"2019-08-22T11:24:02","guid":{"rendered":"https:\/\/www.testpreptraining.com\/tutorial\/?page_id=2267"},"modified":"2019-08-27T07:38:44","modified_gmt":"2019-08-27T07:38:44","slug":"dynamo-db-global-tables","status":"publish","type":"page","link":"https:\/\/www.testpreptraining.ai\/tutorial\/dynamo-db-global-tables\/","title":{"rendered":"Dynamo DB Global Tables"},"content":{"rendered":"\n<p>Amazon DynamoDB global tables\nprovide a fully managed solution for deploying a multiregion, multi-master\ndatabase, without having to build and maintain your own replication solution.\nWhen you create a global table, you specify the AWS Regions where you want the\ntable to be available. DynamoDB performs all of the necessary tasks to create\nidentical tables in these Regions and propagate ongoing data changes to all of\nthem.<\/p>\n\n\n\n<p>To illustrate one use case for a\nglobal table, suppose that you have a large customer base spread across three\ngeographic areas\u2014the US east coast, the US west coast, and western Europe.\nCustomers must update their profile information while using your application.\nTo address these requirements, you could create three identical DynamoDB tables\nnamed CustomerProfiles, in three different AWS Regions. These three tables\nwould be entirely separate from each other. Changes to the data in one table\nwould not be reflected in the other tables. Without a managed replication\nsolution, you could write code to replicate data changes among these tables.\nHowever, doing this would be a time-consuming and labor-intensive effort.<\/p>\n\n\n\n<p>Instead of writing your own code, you could create a global table consisting of your three Region-specific CustomerProfiles tables. DynamoDB would then automatically replicate data changes among those tables so that changes to CustomerProfiles data in one Region would seamlessly propagate to the other Regions. In addition, if one of the AWS Regions were to become temporarily unavailable, your customers could still access the same CustomerProfiles data in the other Regions. <\/p>\n\n\n\n<p>DynamoDB global tables are ideal for massively scaled applications with globally dispersed users. In such an environment, users expect very fast application performance. Global tables provide automatic multi-master replication to AWS Regions world-wide. They enable you to deliver low-latency data access to your users no matter where they are located. <\/p>\n\n\n\n<p><strong>Global Table Concepts <\/strong><\/p>\n\n\n\n<p>A global table is a collection of\none or more replica tables, all owned by a single AWS account.<\/p>\n\n\n\n<p>A replica table (or replica, for\nshort) is a single DynamoDB table that functions as a part of a global table.\nEach replica stores the same set of data items. Any given global table can only\nhave one replica table per AWS Region.<\/p>\n\n\n\n<p>The following is a conceptual\noverview of how a global table is created.<\/p>\n\n\n\n<p>Create an ordinary DynamoDB table, with DynamoDB Streams enabled, in an AWS Region.<\/p>\n\n\n\n<p>Repeat step 1 for every other Region where you want to replicate your data.<\/p>\n\n\n\n<p>Define a DynamoDB global table based on the tables that you have created.<\/p>\n\n\n\n<p>The AWS Management Console automates\nthese tasks, so you can create a global table more quickly and easily. For more\ninformation, see Creating a Global Table.<\/p>\n\n\n\n<p>The resulting DynamoDB global table\nconsists of multiple replica tables, one per Region, that DynamoDB treats as a\nsingle unit. Every replica has the same table name and the same primary key\nschema. When an application writes data to a replica table in one Region,\nDynamoDB automatically propagates the write to the other replica tables in the\nother AWS Regions.<\/p>\n\n\n\n<p>Important<\/p>\n\n\n\n<p>To keep your table data in sync,\nglobal tables automatically create the following attributes for every item:<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;\naws:rep:deleting<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;\naws:rep:updatetime<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;\naws:rep:updateregion<\/p>\n\n\n\n<p>Do not modify these attributes or\ncreate attributes with the same name.<\/p>\n\n\n\n<p>You can add replica tables to the global table so that it can be available in additional Regions. (To do this, the global table must be empty. In other words, none of the replica tables can have any data in them.) <\/p>\n\n\n\n<p>You can also remove a replica table from a global table. If you do this, the table is completely disassociated from the global table. This newly independent table no longer interacts with the global table, and data is no longer propagated to or from the global table. <\/p>\n\n\n\n<p><strong>Consistency and Conflict Resolution <\/strong><\/p>\n\n\n\n<p>Any changes made to any item in any\nreplica table are replicated to all the other replicas within the same global\ntable. In a global table, a newly written item is usually propagated to all\nreplica tables within seconds.<\/p>\n\n\n\n<p>With a global table, each replica\ntable stores the same set of data items. DynamoDB does not support partial\nreplication of only some of the items.<\/p>\n\n\n\n<p>An application can read and write data to any replica table. If your application only uses eventually consistent reads and only issues reads against one AWS Region, it will work without any modification. However, if your application requires strongly consistent reads, it must perform all of its strongly consistent reads and writes in the same Region. DynamoDB does not support strongly consistent reads across Regions. Therefore, if you write to one Region and read from another Region, the read response might include stale data that doesn&#8217;t reflect the results of recently completed writes in the other Region. <\/p>\n\n\n\n<p>Conflicts can arise if applications update the same item in different Regions at about the same time. To help ensure eventual consistency, DynamoDB global tables use a last writer wins reconciliation between concurrent updates, in which DynamoDB makes a best effort to determine the last writer. With this conflict resolution mechanism, all the replicas will agree on the latest update and converge toward a state in which they all have identical data. <\/p>\n\n\n\n<p><strong>Availability and Durability <\/strong><\/p>\n\n\n\n<p>If a single AWS Region becomes isolated or degraded, your application can redirect to a different Region and perform reads and writes against a different replica table. You can apply custom business logic to determine when to redirect requests to other Regions. <\/p>\n\n\n\n<p>If a Region becomes isolated or degraded, DynamoDB keeps track of any writes that have been performed but have not yet been propagated to all of the replica tables. When the Region comes back online, DynamoDB resumes propagating any pending writes from that Region to the replica tables in other Regions. It also resumes propagating writes from other replica tables to the Region that is now back online. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>Amazon DynamoDB global tables provide a fully managed solution for deploying a multiregion, multi-master database, without having to build and maintain your own replication solution. When you create a global table, you specify the AWS Regions where you want the table to be available. DynamoDB performs all of the necessary tasks to create identical tables&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_acf_changed":false,"footnotes":""},"categories":[2],"tags":[7,376,435],"class_list":["post-2267","page","type-page","status-publish","hentry","category-amazon-aws","tag-aws","tag-aws-devops","tag-dynamo-db-global-tables"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v22.1 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Dynamo DB Global Tables - Testprep Training Tutorials<\/title>\n<meta name=\"description\" content=\"A global table is a collection of one or more replica tables, all owned by a single AWS account.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.testpreptraining.ai\/tutorial\/dynamo-db-global-tables\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Dynamo DB Global Tables - Testprep Training Tutorials\" \/>\n<meta property=\"og:description\" content=\"A global table is a collection of one or more replica tables, all owned by a single AWS account.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.testpreptraining.ai\/tutorial\/dynamo-db-global-tables\/\" \/>\n<meta property=\"og:site_name\" content=\"Testprep Training Tutorials\" \/>\n<meta property=\"article:modified_time\" content=\"2019-08-27T07:38:44+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.testpreptraining.ai\/tutorial\/dynamo-db-global-tables\/\",\"url\":\"https:\/\/www.testpreptraining.ai\/tutorial\/dynamo-db-global-tables\/\",\"name\":\"Dynamo DB Global Tables - Testprep Training Tutorials\",\"isPartOf\":{\"@id\":\"https:\/\/www.testpreptraining.ai\/tutorial\/#website\"},\"datePublished\":\"2019-08-22T11:24:02+00:00\",\"dateModified\":\"2019-08-27T07:38:44+00:00\",\"description\":\"A global table is a collection of one or more replica tables, all owned by a single AWS account.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.testpreptraining.ai\/tutorial\/dynamo-db-global-tables\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.testpreptraining.ai\/tutorial\/dynamo-db-global-tables\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.testpreptraining.ai\/tutorial\/dynamo-db-global-tables\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.testpreptraining.ai\/tutorial\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Dynamo DB Global Tables\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.testpreptraining.ai\/tutorial\/#website\",\"url\":\"https:\/\/www.testpreptraining.ai\/tutorial\/\",\"name\":\"Testprep Training Tutorials\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/www.testpreptraining.ai\/tutorial\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.testpreptraining.ai\/tutorial\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.testpreptraining.ai\/tutorial\/#organization\",\"name\":\"Testprep Training\",\"url\":\"https:\/\/www.testpreptraining.ai\/tutorial\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.testpreptraining.ai\/tutorial\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.testpreptraining.com\/tutorial\/wp-content\/uploads\/2020\/07\/tpt-logo-6.png\",\"contentUrl\":\"https:\/\/www.testpreptraining.com\/tutorial\/wp-content\/uploads\/2020\/07\/tpt-logo-6.png\",\"width\":583,\"height\":153,\"caption\":\"Testprep Training\"},\"image\":{\"@id\":\"https:\/\/www.testpreptraining.ai\/tutorial\/#\/schema\/logo\/image\/\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Dynamo DB Global Tables - Testprep Training Tutorials","description":"A global table is a collection of one or more replica tables, all owned by a single AWS account.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.testpreptraining.ai\/tutorial\/dynamo-db-global-tables\/","og_locale":"en_US","og_type":"article","og_title":"Dynamo DB Global Tables - Testprep Training Tutorials","og_description":"A global table is a collection of one or more replica tables, all owned by a single AWS account.","og_url":"https:\/\/www.testpreptraining.ai\/tutorial\/dynamo-db-global-tables\/","og_site_name":"Testprep Training Tutorials","article_modified_time":"2019-08-27T07:38:44+00:00","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.testpreptraining.ai\/tutorial\/dynamo-db-global-tables\/","url":"https:\/\/www.testpreptraining.ai\/tutorial\/dynamo-db-global-tables\/","name":"Dynamo DB Global Tables - Testprep Training Tutorials","isPartOf":{"@id":"https:\/\/www.testpreptraining.ai\/tutorial\/#website"},"datePublished":"2019-08-22T11:24:02+00:00","dateModified":"2019-08-27T07:38:44+00:00","description":"A global table is a collection of one or more replica tables, all owned by a single AWS account.","breadcrumb":{"@id":"https:\/\/www.testpreptraining.ai\/tutorial\/dynamo-db-global-tables\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.testpreptraining.ai\/tutorial\/dynamo-db-global-tables\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.testpreptraining.ai\/tutorial\/dynamo-db-global-tables\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.testpreptraining.ai\/tutorial\/"},{"@type":"ListItem","position":2,"name":"Dynamo DB Global Tables"}]},{"@type":"WebSite","@id":"https:\/\/www.testpreptraining.ai\/tutorial\/#website","url":"https:\/\/www.testpreptraining.ai\/tutorial\/","name":"Testprep Training Tutorials","description":"","publisher":{"@id":"https:\/\/www.testpreptraining.ai\/tutorial\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.testpreptraining.ai\/tutorial\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.testpreptraining.ai\/tutorial\/#organization","name":"Testprep Training","url":"https:\/\/www.testpreptraining.ai\/tutorial\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.testpreptraining.ai\/tutorial\/#\/schema\/logo\/image\/","url":"https:\/\/www.testpreptraining.com\/tutorial\/wp-content\/uploads\/2020\/07\/tpt-logo-6.png","contentUrl":"https:\/\/www.testpreptraining.com\/tutorial\/wp-content\/uploads\/2020\/07\/tpt-logo-6.png","width":583,"height":153,"caption":"Testprep Training"},"image":{"@id":"https:\/\/www.testpreptraining.ai\/tutorial\/#\/schema\/logo\/image\/"}}]}},"_links":{"self":[{"href":"https:\/\/www.testpreptraining.ai\/tutorial\/wp-json\/wp\/v2\/pages\/2267","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.testpreptraining.ai\/tutorial\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.testpreptraining.ai\/tutorial\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.testpreptraining.ai\/tutorial\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.testpreptraining.ai\/tutorial\/wp-json\/wp\/v2\/comments?post=2267"}],"version-history":[{"count":3,"href":"https:\/\/www.testpreptraining.ai\/tutorial\/wp-json\/wp\/v2\/pages\/2267\/revisions"}],"predecessor-version":[{"id":6438,"href":"https:\/\/www.testpreptraining.ai\/tutorial\/wp-json\/wp\/v2\/pages\/2267\/revisions\/6438"}],"wp:attachment":[{"href":"https:\/\/www.testpreptraining.ai\/tutorial\/wp-json\/wp\/v2\/media?parent=2267"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.testpreptraining.ai\/tutorial\/wp-json\/wp\/v2\/categories?post=2267"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.testpreptraining.ai\/tutorial\/wp-json\/wp\/v2\/tags?post=2267"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}