Daily Archives: January 3, 2020

Read-after-write model vs eventually consistency model

Below is the read-after-write model:

GET /key-prefix/cool-file.jpg 404
PUT /key-prefix/cool-file.jpg 200
GET /key-prefix/cool-file.jpg 200

As we can see, file doesn’t exist at beginning. As long as PUT is done, GET always return successfully.

Below is eventually consistency model:

GET /key-prefix/cool-file.jpg 404
PUT /key-prefix/cool-file.jpg 200
GET /key-prefix/cool-file.jpg 404

File doesn’t exist, after PUT is done, GET may or may not return successfully. File is propagating.

References:
https://codeburst.io/quick-explanation-of-the-s3-consistency-model-6c9f325e3f82