Amazon.com 如何使用键值数据存储发挥作用?

发布于 2024-08-17 01:45:38 字数 260 浏览 4 评论 0原文

我听说亚马逊使用键值数据存储 - 它不使用传统的关系规范化数据库。作为一个只使用过传统方法的人来说,这是如何运作的?您不需要执行以下操作吗?

select * from book where book_id = n

或者:

select * from book where author_id = y

如果没有规范化的数据库,如何构建具有如此多数据和如此多关系的网站/应用程序?

I have heard that Amazon uses a key-value data store - that it does not use a traditional relational normalized db. Speaking as someone who only has used the traditional approach, how does this work? Don't you need to do the following?

select * from book where book_id = n

Or a:

select * from book where author_id = y

How can you build a site/app with so much data and so many relationships without a normalized db?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

浊酒尽余欢 2024-08-24 01:45:38

Amazon.com 的架构非常有趣。他们转向了面向服务的架构,如果您查看其网站上的所有不同内容区域,就会发现每个区域都由不同的服务提供服务。因此,有“愿望清单”服务和“与您查看过的商品相关”服务,以及畅销书服务、购物车服务等。

每种服务都有自己的一组要求和功能。这些要求包括响应时间和可用性等。在内部,每个服务都是使用最适合需求的数据库来实现的。键值存储对于购物车很有用,因为您永远不需要

select * from book where book_id = n

在购物车上执行以下操作。

需要认识到的重要事情之一是可用性在亚马逊规模上发挥的巨大作用。考虑一下亚马逊 2008 年的收入为 191.66 亿美元。白天,来自 Amazon.com 网站的总零售收入可能会超过每秒 1000 美元(据我所知,在高峰时段可能是该数字的两倍。在假日购物高峰期间可能是该数字的 5 倍)。考虑一下如果购物车服务在高峰使用期间中断 3 分钟,会产生什么样的成本。很明显,废弃购物车的损失将是巨大的美元价值。

使用键值存储并不意味着要接受大量的数据重复,而是意味着重新设计应用程序,这样必要的数据就不需要全部放在一个单一的数据库中。

亚马逊实际上更像是一个应用程序平台。这是亚马逊 CTO 的视频谈论这一点。

The Amazon.com architecture is very interesting. They moved to a service oriented architecture, if you look at all the different content areas on their site, each one is served by a different service. So there is a 'wish list' service and a 'Related to Items You've Viewed' service, and Bestsellers service, Shopping cart service, etc.

Each of the services has its own set of requirements and features. The requirements include things like response time and availability. Internally each service is implemented using whatever database best suits the needs. The key value store is good for a shopping cart, because you never need to do:

select * from book where book_id = n

on a shopping cart.

One of the important things to realize is the enormous role that availability plays at Amazon scale. Consider that Amazon 2008 revenue was $19.166 billion. The total retail revenue from from the Amazon.com site may be more than $1000 per second during the day (it may be double that, for all I know, during peak hours. It could be 5 times that during peak holiday shopping). Think of the cost if the shopping cart service goes down for 3 minutes during peak usage. It is clear that the loss would be a large dollar value in abandon carts.

Using a key-value store doesn't mean embracing rampant data duplication, it means redesigning applications so the necessary data doesn't need sit all in one monolithic database.

Amazon is really more of a platform for applications than anything else. Here is a video of Amazon's CTO talking about just that.

最佳男配角 2024-08-24 01:45:38

它仅使用其 Dynamo 键值存储进行购物购物车并选择其他应用程序。

It only uses its Dynamo key-value store for its shopping cart and select other applications.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文