使用S3作为Web应用程序的主要数据库

huangapple go评论131阅读模式
英文:

Using S3 as a primary database for web applications

问题

除了Dyno之外,还有没有其他使用S3(Amazon、Wasabi或S3兼容)对象存储作为主要数据库的努力?例如,存储JSON数据和其他实体。

S3不提供原子事务或批量事务,因此为了防止键重复或键被应用程序的其他实例意外覆盖(例如),据我所知,需要对键进行分布式缓存(例如使用EHCache或类似的东西)。这是我能看到的主要缺点之一。

类似地,如果您的应用程序需要实现“要么全部,要么都不要”的事务,例如存储两个对象或完全不存储,则除非(至少解决问题的一部分)有一种分布式锁定机制,否则这是不可能的,因为应用程序的实例可以在存储键时独占地拥有一段时间的排他锁,而实际上它是在保存到S3。

在使用S3作为主要数据库时,如何实现这样的机制来模拟事务?

英文:

Apart from Dyno are there any efforts to use S3 (Amazon, Wasabi, or S3-Compatible) object storage as a primary database? For example, storing JSON data and other entities.

S3 does not offer atomic transaction nor batch transactions, thus, in order to prevent key duplication or key accidentally overridden by other instances of an application (for example) a distributed caching of keys is required afaik (e.g. using EHCache or something similar.) This is one of the main drawbacks I can see.

Similarly, if you need to have your application have an "all-or-nothing", again transactions, e.g. store two objects or none at all, this is not possible except (at least solving one part of the problem) to have a distributed locking mechanism, as such an instance of an application, can have an exclusive lock for a certain period of time for the keys to store while it is actually saving to S3.

How do you implement such a mechanism to emulate transactions when using S3 as the primary database?

答案1

得分: 1

你可以实现一个仅追加数据库,它是交易日志,但效率可能不会太高。

S3的问题在于它提供写入后读取一致性,但除此之外,你不能真正依赖事物的一致性。

英文:

You might implement an append-only database that is a log of transactions, but it won't be too efficient.

The problem with S3 is that it provides read after write consistency, but otherwise you can't really depend on things being consistent.

huangapple
  • 本文由 发表于 2020年9月11日 15:55:25
  • 转载请务必保留本文链接:https://go.coder-hub.com/63842979.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定