What does read-after-write consistency really mean on new object PUT in S3?
Asked Answered
H

3

31

Amazon documentation (http://docs.aws.amazon.com/AmazonS3/latest/dev/Introduction.html#ConsistencyModel) states:

"Amazon S3 provides read-after-write consistency for PUTS of new objects in your S3 bucket in all regions with one caveat."

Ignoring the caveat, this means that a client issuing a GET following a PUT for a new object is guaranteed to get the correct result. My question is, would the guarantee also apply if the GET is issued from a different client not the one which did the PUT (assuming of course the GET follows the PUT chronologically)? In other words, is read-after-write consistency simply read-your-write consistency or it works for all clients?

I suspect the answer is that it works globally but can't find a definitive answer.

Heymann answered 22/3, 2017 at 16:29 Comment(4)
The question is actually harder than it seems, and deals with speed of light and Special Relativity, no kidding. The problem is to determine whether a client issued GET before or after another client. The thing is that it's only possible to determine up to a specific precision limit, that depends on distance between clients. It's not possible to order their requests in time with arbitrary precision, e.g. they can be both "after" each other. That's why concurrency discussion usually from a point of view of one client, or some "master".Factorage
Hey, its been some time since your question but couldn't find much on the internet. Have you been able to confirm this is not a read-after-your-write thing for sure?Crackbrained
Yes I did confirm, it does work globally across all clients.Heymann
So how is this any different from eventual consistency?Hithermost
A
19

Yes, it would be consistent.

The concept of a 'client' is irrelevant because each API call is independent.

The us-east-1 region (previously known as US-Standard) previously did not have read-after-write consistency, but it is now provided in all regions.

Alsup answered 22/3, 2017 at 21:55 Comment(0)
N
10

I've always assumed that same you, i.e. that read-after-write applies to all clients, not just the client that did the write.

This blog post seems to confirm it (for what its worth), but I also did not find any definitive answer on official AWS docs:

https://shlomoswidler.com/2009/12/read-after-write-consistency-in-amazon.html

What is Read-After-Write Consistency?

Read-after-write consistency tightens things up a bit, guaranteeing immediate visibility of new data to all clients. With read-after-write consistency, a newly created object or file or table row will immediately be visible, without any delays.

Nieves answered 22/3, 2017 at 17:52 Comment(1)
shlomoswidler.com/2009/12/… This page is not found.Placement
G
7

As of Dec 1, 2020 (https://aws.amazon.com/blogs/aws/amazon-s3-update-strong-read-after-write-consistency/) S3 does provide strong read after write consistency. However, it's still not clear that GET from a different client (other than the client which sent PUT request) will see the updated result. The blog mentions, "What you write is what you will read, and the results of a LIST will be an accurate reflection of what’s in the bucket."

Also in the distributed systems literature there is 'read-your-own-write' consistency model and a 'consistent read across clients after write' is the ultimate objective (not saying that it's impossible).

I suspect that S3 is eventually consistent for reads from different clients. There should be more clarity from AWS on this point, I feel.

Georgettegeorgi answered 10/1, 2021 at 9:19 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.