{"id":31092,"date":"2020-12-21T16:35:33","date_gmt":"2020-12-21T21:35:33","guid":{"rendered":"https:\/\/mjtsai.com\/blog\/?p=31092"},"modified":"2020-12-21T17:00:18","modified_gmt":"2020-12-21T22:00:18","slug":"s3-strong-consistency","status":"publish","type":"post","link":"https:\/\/mjtsai.com\/blog\/2020\/12\/21\/s3-strong-consistency\/","title":{"rendered":"S3 Strong Consistency"},"content":{"rendered":"<p><a href=\"https:\/\/aws.amazon.com\/about-aws\/whats-new\/2020\/12\/amazon-s3-now-delivers-strong-read-after-write-consistency-automatically-for-all-applications\/\">Amazon<\/a> (via <a href=\"https:\/\/twitter.com\/timbray\/status\/1333943973040115712\">Tim Bray<\/a>, <a href=\"https:\/\/news.ycombinator.com\/item?id=25271791\">Hacker News<\/a>):<\/p>\n<blockquote cite=\"https:\/\/aws.amazon.com\/about-aws\/whats-new\/2020\/12\/amazon-s3-now-delivers-strong-read-after-write-consistency-automatically-for-all-applications\/\"><p>Amazon S3 now delivers strong read-after-write consistency automatically for all applications. Unlike other cloud providers, Amazon S3 delivers strong read-after-write consistency for any storage request, without changes to performance or availability, without sacrificing regional isolation for applications, and at no additional cost.<\/p><\/blockquote>\n\n<p><a href=\"https:\/\/aws.amazon.com\/blogs\/aws\/amazon-s3-update-strong-read-after-write-consistency\/\">Jeff Barr<\/a>:<\/p>\n<blockquote cite=\"https:\/\/aws.amazon.com\/blogs\/aws\/amazon-s3-update-strong-read-after-write-consistency\/\"><p>One of the more interesting (and sometimes a bit confusing) aspects of S3 and other large-scale distributed systems is commonly known as eventual consistency. In a nutshell, after a call to an S3 API function such as PUT that stores or modifies data, there&rsquo;s a small time window where the data has been accepted and durably stored, but not yet visible to all GET or LIST requests.<\/p>\n<p>[&#8230;]<\/p>\n<p>Effective immediately, all S3 <a href=\"https:\/\/docs.aws.amazon.com\/AmazonS3\/latest\/API\/API_GetObject.html\">GET<\/a>, <a href=\"https:\/\/docs.aws.amazon.com\/AmazonS3\/latest\/API\/API_PutObject.html\">PUT<\/a>, and <a href=\"https:\/\/docs.aws.amazon.com\/AmazonS3\/latest\/API\/API_ListObjectsV2.html\">LIST<\/a> operations, as well as operations that change <a href=\"https:\/\/docs.aws.amazon.com\/AmazonS3\/latest\/API\/API_PutObjectTagging.html\">object tags<\/a>, <a href=\"https:\/\/docs.aws.amazon.com\/AmazonS3\/latest\/API\/API_PutObjectAcl.html\">ACLs<\/a>, or metadata, are now strongly consistent. What you write is what you will read, and the results of a LIST will be an accurate reflection of what&rsquo;s in the bucket. This applies to all existing and new S3 objects, works in all regions, and is available to you at no extra charge! There&rsquo;s no impact on performance, you can update an object hundreds of times per second if you&rsquo;d like, and there are no global dependencies.<\/p><\/blockquote>\n\n<p>They don&rsquo;t say how this works, but presumably the tradeoff is reduced availability, with the expected latency and error rate low enough that you don&rsquo;t mind.<\/p>\n\n<p><a href=\"https:\/\/news.ycombinator.com\/item?id=25273512\">25519FUUU<\/a>:<\/p>\n<blockquote cite=\"https:\/\/news.ycombinator.com\/item?id=25273512\"><p>The most devious s3 consistency issue I encountered was that S3 bucket configs are actually stored in S3, and were not read-after-write consistent.<\/p><p>It was bad. In order to &ldquo;update&rdquo; a bucket config programmatically you need to read the entire existing config, make an update, and then PUT it back (overwriting what&rsquo;s there). The problem is when you went to read the config it&rsquo;s possibly 15 minutes old or more, and when you put it back you overwrite any changes that may not be consistent.<\/p><\/blockquote>\n\n<p>Previously:<\/p>\n<ul>\n<li><a href=\"https:\/\/mjtsai.com\/blog\/2016\/03\/15\/dropboxs-exodus-from-the-amazon-cloud-empire\/\">Dropbox&rsquo;s Exodus From the Amazon Cloud Empire<\/a><\/li>\n<li><a href=\"https:\/\/mjtsai.com\/blog\/2013\/05\/11\/the-cap-faq\/\">The CAP FAQ<\/a><\/li>\n<\/ul>","protected":false},"excerpt":{"rendered":"<p>Amazon (via Tim Bray, Hacker News): Amazon S3 now delivers strong read-after-write consistency automatically for all applications. Unlike other cloud providers, Amazon S3 delivers strong read-after-write consistency for any storage request, without changes to performance or availability, without sacrificing regional isolation for applications, and at no additional cost. Jeff Barr: One of the more interesting [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"apple_news_api_created_at":"2020-12-21T21:35:37Z","apple_news_api_id":"ca9c4cb2-aed7-4fcb-8c16-572e01a5fb57","apple_news_api_modified_at":"2020-12-21T22:00:22Z","apple_news_api_revision":"AAAAAAAAAAAAAAAAAAAAAA==","apple_news_api_share_url":"https:\/\/apple.news\/AypxMsq7XT8uMFlcuAaX7Vw","apple_news_coverimage":0,"apple_news_coverimage_caption":"","apple_news_is_hidden":false,"apple_news_is_paid":false,"apple_news_is_preview":false,"apple_news_is_sponsored":false,"apple_news_maturity_rating":"","apple_news_metadata":"\"\"","apple_news_pullquote":"","apple_news_pullquote_position":"","apple_news_slug":"","apple_news_sections":"\"\"","apple_news_suppress_video_url":false,"apple_news_use_image_component":false,"footnotes":""},"categories":[4],"tags":[21,672,800,263,71,50],"class_list":["post-31092","post","type-post","status-publish","format-standard","hentry","category-programming-category","tag-s3","tag-amazon-web-services","tag-concurrency","tag-theory","tag-programming","tag-webapi"],"apple_news_notices":[],"_links":{"self":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/31092","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/comments?post=31092"}],"version-history":[{"count":2,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/31092\/revisions"}],"predecessor-version":[{"id":31104,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/31092\/revisions\/31104"}],"wp:attachment":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/media?parent=31092"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/categories?post=31092"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/tags?post=31092"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}