最近,S3 announces strong read-after-write consistency。我很好奇如何编程。它不是违反CAP定理吗?
在我看来,最简单的方法是等待复制发生然后返回,但这会导致性能下降。
AWS表示没有性能差异。如何实现的?
另一个想法是,亚马逊有一个巨大的索引表,可以跟踪所有S3对象及其存储位置(我相信三重复制)。并且它将需要在每个PUT/DELTE处更新此索引。在技术上可行吗?
最佳答案
如上面的Martin所示,有一个指向Reddit的链接,其中讨论了this。来自u/ryeguy的最高答复给出了以下答案:
If I had to guess, s3 synchronously writes to a cluster of storage nodes before returning success, and then asynchronously replicates it to other nodes for stronger durability and availability. There used to be a risk of reading from a node that didn't receive a file's change yet, which could give you an outdated file. Now they added logic so the lookup router is aware of how far an update is propagated and can avoid routing reads to stale replicas.
I just pulled all this out of my ass and have no idea how s3 is actually architected behind the scenes, but given the durability and availability guarantees and the fact that this change doesn't lower them, it must be something along these lines.
欢迎提供更好的答案。
关于amazon-web-services - 您如何在分布式系统中编程强大的写后读一致性?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65328318/