本集简介
双语字幕
仅展示文本字幕,不包含中文音频;想边听边看,请使用 Bayt 播客 App。
AWS S3 是全球最大的云存储服务。
AWS S3 is the world's largest cloud storage service.
但它的规模到底有多大呢?
But just how big is it?
它是如何在如此庞大的规模下,做到如此高可靠性的?
And how is it engineered to be as reliable as it is at such a massive scale?
梅兰是 AWS 数据与分析部门的副总裁,已经负责 S3 十三年了。
Mai-Lan is the VP of data and analytics at AWS and has been running S3 for thirteen years.
今天我们聊一聊:S3 存储的数据量和运行的服务器数量有多惊人;AWS 是如何在一夜之间,从最终一致性转向强一致性的;这一转变背后有多复杂的工程挑战;什么是相关性故障、崩溃一致性,以及容错设计?
Today we discuss: The sheer scale of S3 in the data stored and the number of servers it runs on How seemingly overnight AWS went from an eventually consistent data store to a strongly consistent one And the massive engineering complexity behind this move What is correlated failure, crash consistency and failure allowances?
为什么 S3 的工程师们天天都围绕这些概念工作?
And why engineers on S3 live and breathe these concepts?
在 S3 这种规模下,为什么形式化方法对确保正确性如此重要?
The importance of formal methods to ensure correctness at S3 scale?
还有很多其他内容。
And many more.
这些话题大多是AWS工程团队平时从不对外公开讨论的。
A lot of these topics are ones that AWS engineering rarely talks about in public.
希望你能喜欢这些难得的内部细节。
I hope you enjoy these rare details shared.
如果你对世界上最大系统之一是如何构建并持续演进的感兴趣,这一期绝对值得听。
If you're interested in how one of the largest systems in the world is built and keeps evolving, this episode is for you.
本期节目由Statsig赞助播出,这是一家集标志管理、数据分析和实验于一体的统一平台。
This episode is presented by Statsig, the unified platform for flags, analytics experiments, more.
详情请查看节目说明,了解更多关于他们以及其他资深赞助商的信息。
Check out the show notes to learn more about them and our other seasoned sponsors.
那么,Mai-Lan,欢迎来到我们的播客。
So, Mai-Lan, welcome to the podcast.
谢谢邀请我。
Thanks for having me.
先从头说起,你能说说S3现在的规模有多大吗?
To kick things off, can you tell me the scale of S3 today?
如果你退一步来看S3,它其实就是个存放海量数据的地方。
Well, if you wanna take a step back and just think about S3, it is a place where you put an incredible amount of data.
目前,S3里存储的对象已经超过五十万亿个。
And so right now, S3 holds over 500,000,000,000,000 objects.
我们拥有数百艾字节的数据,每秒在全球范围内处理数亿次请求。
We have hundreds of exabytes of data, and we serve hundreds of millions of transactions per second worldwide.
如果你还想听个更惊人的数字,我们每年处理的请求超过一千万亿次。
And if you want another fun stat, we process over a quadrillion requests every single year.
而这一切背后所依赖的基础设施,规模也同样惊人。
And what's under the hood of all that is also pretty amazing scale.
想想S3底层是什么?其实就是硬盘和服务器,放在机架上,机架再放进数据中心。
If you think about, you know, what's underneath the hood of S3, fundamentally, were disks and servers which sit in racks, and those sit in buildings.
如果要细数底层的规模,我们管理着数千万块硬盘、上百万台服务器,分布在38个区域、120个可用区,想想真不容易。
And if you try to think about all of the scale of what is under the hood, we manage tens of millions of hard drives across millions of servers, and that is in a 120 availability zones across 38 regions, which is pretty amazing if you think about it.
归根结底,这一切都从服务器里的硬盘开始,然后是机架,一排排机架,一栋栋机房。
So deep down, it it all starts with hard drives sitting inside servers, sitting inside racks, and then you have a bunch of these racks, and then rows of them, buildings of them.
对吧?
Right?
这正是你刚才说的。
And that's what you said.
所以,底层其实有数千万块硬盘。
So there's tens of millions of hard drives deep down in in in in the bottom of this.
没错。
That's right.
如果你想象把我们所有的硬盘一个叠一个堆起来,能从地面一直堆到国际空间站,再折返回来。
In fact, if you think about the scale of this, if you imagine stacking all of our drives one on top of another, it would go all the way to the International Space Station and just about back.
对我们这些做这个服务的人来说,这种画面挺有意思的,但说到底,S3的规模真的很难用常理去想象。
And so like that, I mean, it's kind of a fun visual to have for us who work on the service, but, you know, kind of fundamentally, it's really hard to get your brain around the scale of S3.
很多客户其实根本想不了这么多。
And so a lot of our customers, they don't.
他们只是默认规模就在那儿,硬盘永远在线,他们只关心一件事:S3就是能用。
They assume the scale is there, they assume that, you know, all of the drives are always there, and they just focus on what S3 is to them, which is it just works.
无论什么类型的数据,它都能正常工作,所有数据都一样。
It just works for any type of data and all of your data.
没错,就连我,说到艾字节的时候,都得去查一下,因为我知道拍字节已经很大了,一家公司有个一两三个拍字节的数据,就已经是海量了。
Yeah, even if, I mean, even for me for the scale, when you talk about exabytes, I actually had to look up exabytes because I know a petabyte, is already massive, a company has like one or two or three petabytes of data, it's tons.
而艾字节呢,没错,就是一千个拍字节,你刚才说你们的思维已经是在这个量级上了。
And exabyte is it a yes, it's a thousand petabytes is an exabyte and you told me that you're thinking in that level.
这真的很难想象。
It's just hard to fathom.
是的。
Yeah.
我们确实有单个客户,他们的数据量就达到了艾字节级别。
We I mean, we have individual customers that have exabytes of data.
有些客户单个就存了艾字节的数据,他们管这叫数据湖。
Individual customers have exabytes of data in what they call a data lake.
不过上周,我听到一个特别棒的说法。
Although, last week, I heard a great term.
索尼集团的CEO谈到了索尼在数据方面的做法,他们称之为‘数据海洋’。
We had the Sony Group CEO talk about what Sony is doing with data, and they refer to it as a data ocean.
不是什么‘数据湖’,而是‘数据海洋’。
And not a data lake, but a data ocean.
如果你的数据湖里已经有艾字节级别的数据,那它本质上就是一片数据海洋,而这片海洋的基础其实就是S3。
And so, like, if you have exabytes of data in your data lake, it is in fact a data ocean, and that ocean is is kind of fundamentally S3.
你能跟我讲讲S3是怎么起源的吗?
Can you tell me how S3 started?
我做过一些研究,听说有个资深工程师坐在西雅图的一家酒吧里,不知道这事儿是不是真的,但我读到的说法是,他当时对亚马逊的工程师们反复搭建同样的基础设施感到很头疼。
I I did some research and there was a story about a distinguished engineer sitting in a pub in Seattle, who knows if was true or not, but I read that this was a story that he was a bit frustrated with engineers at Amazon building a lot of infrastructure, again and again.
是的。
Yeah.
如果你回溯一下,S3的开发其实始于2005年,我们在2006年推出了它,作为第一个AWS服务。
If you think back into you know, S3 development really started in 2005, and we launched as the first AWS service in 2006.
想想2006年的技术环境,那时候很多客户都在搭建电子商务网站,对吧?
And if you think about the technical problems of 2006, you know, a lot of customers were building things like e commerce websites, right?
就像亚马逊网站那样。
Like amazon.com.
所以亚马逊的工程师们知道,当时他们手上有大量非结构化的数据。
And so the engineers at Amazon knew that they had a lot of data that at the time was very unstructured data.
这些数据包括PDF文件、图片、备份文件,他们需要一个经济实惠的存储方案,让我不用操心存储空间的增长问题。
It was PDFs, it was images, it was backups, and they needed a place where they could store that at an economic price point that let them not think about the growth of storage.
于是他们开发了S3,而且是专门为这类存储需求设计的。
And so they built S3 and they really built it for a certain type of storage.
2006年S3最初的架构,核心就是最终一致性。
And so the original design of S3 in 2,006 was really anchored around eventual consistency.
所谓最终一致性,就是当你往S3存数据时,我们不会在你上传后立刻给你确认,除非我们确实已经收到了你的数据。
And the idea of eventual consistency is that when you put data in storage, for S3, we're not gonna give you an act back on your put unless we actually have your data.
数据是收到了,但如果你马上去列出文件,可能还看不到,因为系统还在同步中。
So we have your data, but the eventual consistency part is that if you were to list your data, it might not show up because it's being eventually consistent.
数据是存在的,只是列表里暂时显示不出来。
It's there, but it might not show up on a list.
所以我们当时选择这种一致性模型,主要是为了优化持久性和可用性。
And so we did that at the time that a consistency model at the time, we built that because we were really optimizing for things like durability and availability.
这对电商网站来说效果非常好,因为当用户浏览电商页面时,如果图片刚好没及时加载出来,也没关系——用户刷新一下就好了。
And it worked like a champ for, you know, e commerce sites and things like that because, you know, when a human was interacting with an e commerce site and an image happened to not show up exactly at the moment where you put the data into storage, it was okay because a human would just refresh.
2006年我们上线的时候,有个有趣的事想跟你说。
And so when we launched in 2006, here's a fun fact for you.
实际上,2006年也是Apache Hadoop刚刚在社区里起步的时候。
2006 is actually when Apache Hadoop first began as a community as well.
当时像Netflix和Pinterest这样的前沿数据客户,注意到了Hadoop,把它们和S3的经济性与特性结合了起来——也就是近乎无限的存储空间、不错的性能,还有极低的价格。
And so we had a set of what I think of as frontier data customers like Netflix and Pinterest, who took a look at things like Hadoop, and they put it together with the economics and the attributes of S3, which is, you know, unlimited storage with pretty good performance and a great price point.
于是他们决定打造我们当时称之为数据湖的系统。
And they decided to build their, you know, what we first began to call data lakes at the time.
他们想把非结构化存储的理念进一步扩展,加入表格型数据。
They decided to build to extend the idea of unstructured storage and include things like tabular data.
第一批前沿数据客户大约在2013到2015年间开始采用所谓的数据湖。
And so the first wave of frontier data customers were adopting quote unquote data lakes in about 2013 to 2015.
这些是生在云时代的前沿数据用户。
Those were the frontier data customers born in the cloud.
从2015年到2020年左右,我们开始看到各大企业也跟进这种模式:怎么把S3——这个全球非结构化数据的中心——延伸到结构化数据上?
And around 2015 to, I would say, 2020, we started to see all the enterprises take that same data pattern of how can I use S3, the home of all the unstructured data, you know, on the planet and extend it to tabular data?
大概五年前,也就是2020年,我开始看到海量的Parquet文件,数量达到艾字节级别。
And that's when about five years ago, 2020, I started to see a ton of exabytes of, you know, basically Parquet files.
我一直在做S3,时间不短了。
And I have worked on S3 for a minute.
我从2013年初就开始参与S3的开发。
I started working on S3 in early twenty I guess it was 2013.
我2010年就加入AWS了,算起来已经很久了。
I've been at AWS since 2010, so kind of a while.
Parquet的兴起特别有意思,因为人们开始说:S3的这些优势我很喜欢,我想把它用在表格数据上。
And the rise of Parquet was really interesting because what people did is they said, Oh, okay, I like the traits and the attributes of S3, and I wanna apply it to a table.
所以我决定把我的Parquet数据直接存到S3里。
And so I am gonna run my own Parquet data in S3.
然后大概在2020年前后,我们开始看到Iceberg的兴起。
And then, you know, around '20, I would say nineteen, twenty twenty, we started to see basically the rise of Iceberg.
那时候,Iceberg在实际应用中非常流行。
And Iceberg at the time, you know, is incredibly popular OTF.
它为底层的Parquet数据带来了表结构的特性。
And it gives the table attributes to the underlying Parquet data.
很多客户,尤其是我那些跨行业的大数据湖用户,都开始采用这种方式。
And customers started to do it in, you know, many of my largest data lakes across different industries and different customers.
所以我们在2024年推出了一项新功能:S3表。
And so one of the things that we did in 2024 is we introduced S3 table.
对于还不了解Iceberg的人,我简单说一下。
Just for those who don't know what Iceberg is.
它是一种开源的数据格式,专门用于大规模分析型工作负载,对吧?
So it's an open source data format for like massive analytic workflows, right?
没错。
That's right.
如果我问这些数据海洋的客户,他们为什么这么看重Iceberg,答案是他们希望实现一种所谓的去中心化分析架构——不同业务线或公司内部团队可以自由选择分析工具,只要符合Iceberg标准就行。
If I ask our customers of these data oceans why they care so much about Iceberg, it's because they wanna be able to have what a lot of customers are calling this decentralized analytics architecture, where, you know, they can have lines of businesses or different teams within their company that pick what type of analytics to use, as long as it's Iceberg compliant.
所以,如果把Iceberg看作是结构化数据的通用标准,那你就拥有了选择权。
And so if Iceberg is the common metaphor for data, for tabular data, then you have choice.
在去中心化的分析架构里,你可以灵活选择不同的分析引擎,完全不受限制。
You have flexibility and choice for what type of analytics engines you use in a decentralized analytics architecture.
我觉得这也是Iceberg迅速流行的原因:它不仅让大规模使用数据变得简单,还为企业的业务负责人、首席数据官或者CTO们提供了分析架构的长期保障。
And so I think that's one of the reasons why Iceberg has just taken off, is that it makes it easy to use data at scale, but it also gives a business owner, the chief data officers or the CTOs of the world, it gives them future proofing for analytics.
他们随时可以替换或升级分析系统,接入新的分析工具或AI技术,因为底层的S3上已经有了Iceberg这个稳固的基础。
They can replace their analytics, they can change it out, they can adopt new types of analytics and AI, because you have this iceberg at the bottom turtle of S3.
我们在2024年12月推出了S3表格功能。
We launched S3 tables in 2000 in December 2024.
今年,我们为S3表格新增了十五项以上的新功能。
This year, we've had over 15 new features that we've added to S3 tables.
今年七月,我们还发布了S3向量功能的预览版。
And then this year, of course, we launched the preview of S3 Vectors in July.
上周,我们正式全面上线了。
And then last week, we were generally available.
所以,S3 的故事其实是客户为数据写出来的,而我们能参与这些不断演进的功能开发,真的特别有意思。
And so, you know, the story of S3, it's like a story that our customers have written for data, but it's been super fun to work on all these different evolving attributes.
作为一名工程师,刚开始接触 S3 时,我应该了解哪些基本架构和术语?
As an engineer, what is the kind of basic architecture and the basic terminology I should know about when I'm starting to work with S3?
我们2006年刚推出时,S3 的核心目标就是提供极简的开发者体验。
When we first launched in 2006, the whole goal for S3 is to provide a very simple developer experience.
我们一直坚持这个原则。
And we've really tried to stick with that.
事实上,每当工程师们聚在一起讨论下一步该做什么,我们总会回到这个问题:怎样才能让 S3 更简单易用?
In fact, when the engineers and, you know, when we're sitting around and we're talking about what do we build next, we always go back to that idea of how do you make things really simple to use S3?
从根本上说,S3 现在功能很多,但核心其实就是两个操作:存和取。
And so fundamentally, S3, we have a lot of different capabilities now, but it's really about the put and the get.
把数据存进去,再把数据取出来。
The put of the storage in and the get of the storage out.
而我们能在大规模下做得特别好的地方,正是 S3 的核心。
And where we can do that really well at scale, that is kind of the heart of S3.
现在我们陆续推出了一大堆额外的功能。
Now we have a ton of extra capabilities that we've launched over time.
但说到底,客户一想到用 S3,脑子里想的还是上传和下载。
But, you know, fundamentally, when customers think about using S3, they think about the put and the get.
对。
Yeah.
就是上传数据、下载数据,当然还有一些其他的操作。
So like put data, get data, and I guess some of the other, like, operations.
有点像 HTTP。
It's a bit like HTTP.
对吧?
Right?
还有删除、列出、复制,另外还有一些基本的操作。
There's also delete, list, copy, a few kind of other, like, I guess, primitives.
确实有。
There is.
而且,随着时间推移,我们根据开发者实际在做的事情,陆续加了不少新功能,你知道的。
And, you know, if I think about where we have gone over time, we've added capabilities on top of that, just based on what developers are trying to do, okay?
就拿 put 来说吧。
Let's just take put, okay?
最近我们给 put 功能增加了一组条件判断。
Recently added a set of conditionals to the put capability.
去年我们推出了 put if absent 和 put if match。
And like last year, we did put if absent or put if match.
今年我们又加了 copy if absent、put if match,还有 delete if match。
This year, we did a copy if absent or put if match, and we did delete if match.
对我们来说,条件判断的核心价值在于,能让开发者在执行 put 这类操作时,根据应用自身的运行行为来决定怎么做。
And the the core thing about for for us with conditionals is that we can give developers the capabilities of doing things like the put, but to do it based on the behaviors of their application.
除了 get 和 put 这些基本操作,你至少得知道几个基础概念:存储桶、对象和键,对吧?
Outside of the get input, the basic operations, I guess the base terminology that you should just know about is the buckets, objects, and keys, right?
这就是我们看待数据的方式。
That's how we think about our data.
是的。
Yeah.
现在可不只是对象了。
And now it's not just objects.
如果你想想我们最近为 S3 原生引入的两个新基础组件,一个是 S3 表格的 Iceberg 表,另一个就是向量。
If you think about the two latest primitives or building blocks we've introduced as native to S3, one of them is the Iceberg table with our S3 tables, and the other one is vectors.
S3 表格底层是一组我们替你管理的 Parquet 文件,但向量可不是这样。
And under the hood of an S3 table is a set of Parquet files that we're managing on your behalf, but that's not the case for vectors.
向量其实就是一长串数字,这是我们新引入的一种数据结构,它和你的对象一样,直接存放在 S3 里。
A vector is just basically a long string of numbers, and that is a new data structure for us, and it's sitting in S3 just like your objects.
梅兰刚才谈到了 S3 的基础组件,比如 put、get、表格和向量。
Mai-Lan was talking about the building blocks of S3, like the put, get, tables, and vectors.
说到构建应用的基础组件,自然就引出了我们的长期赞助商 WorkOS。
Speaking of primitives for building applications leads nicely to our seasoned sponsor, WorkOS.
WorkOS 提供了一套基础组件,帮助你的应用满足企业级需求。
WorkOS is a set of primitives to make your application enterprise ready.
比如单点登录、身份验证、目录同步、MCP 认证,还有很多其他功能。
Primitives like single sign on, authentication, directory sync, MCP authentication, and many others.
光靠一个功能,是没法让应用真正达到企业级标准的。
One feature does not make an app enterprise ready.
真正解决问题的,是这些基础组件协同作用,一起满足企业的需求。
Rather, it's a combination of primitives altogether that solves enterprise needs.
当你的产品规模扩大时,你可以随时从 AWS 这类平台获取新的基础设施组件。
When your product grows in scale, you can always reach for new building blocks for infrastructure from places like AWS or similar.
同样,当你想进军高端市场、向大型企业销售时,WorkOS 就能提供你需要的应用层组件。
Similarly, when you need to go upmarket and sell to larger enterprises, WorkOS provides the application level building blocks that you need for this.
WorkOS 已经经历过各种边缘情况和企业级复杂场景,帮你把这些问题都解决了,让你能专心做自己的核心产品。
WorkOS has seen the edge cases, the enterprise complexity, and solves this for you so you can focus on your core product.
其中一个例子,就是在你的 MCP 服务器上集成身份验证功能。
One example of such a building block is adding authentication to your MCP server.
当你准备登录MCP服务器时,通常会看到这个界面。
This is a typical screen when you are about to authenticate with an MCP server.
如果要从零开始搭建,背后的OAuth流程会非常复杂。
If you would have to build it from scratch, it gets pretty complex to set up the OAuth flows behind the scenes.
但使用WorkOS,只需要几步简单的操作就行。
But with WorkOS, it's a few simple steps.
把AltKit组件添加到你的项目里,再通过界面配置一下。
Add the AltKit component to your project, configure it via the UI.
然后让MTP服务器的用户通过AltKit授权,再用几行代码验证返回结果,基本就完成了。
Then you just direct clients of your MTP server to authorize via AltKit, verify the response you get via some code, and that's pretty much it.
这就是设计良好的基础组件带来的力量。
This is the power of well built primitives.
想了解更多,请访问workos.com。
To learn more, head to workos.com.
好了,接下来我们回到S3,说说它是怎么起步的。
And with this, let's get back to S3 and how it all started.
我想还是回到S3的最初阶段聊聊。
So I I I'd I'd like to still go back to the beginning of of S3.
刚上线时,整个行业都震惊了,因为S3的定价是每GB每月15美分,比其他任何服务便宜了三分之二到五分之四。
When it was launched, it was pretty shocking for the broader community because S3 launched with a pricing of 15¢ per gigabyte per month, which was about a third to fifth cheaper than anything else.
那时候的市场价大概是50到75美分。
The going rate at the time was something like 50¢ or 75¢.
第一天我就看到,有整整一万两千名开发者立刻注册,很多公司也迅速迁移到了S3。
And on the first day, I I read that, like, 12,000 developers signed up immediately, a lot of companies immediately or very quickly moved over.
更让人没想到的是,S3之后还在不断降价。
And then the surprising thing was that S3 kept cutting prices.
以前从来没人这么干过。
It was unheard of before.
你当时就在现场,记得二月份那次大幅降价吧?
You were there in the February when some large price cuts happened.
能说说S3团队当时是怎么考虑这种反常定价的吗?
Can you tell me what was the thinking inside the S3 team on the this unusual pricing?
看起来客户其实愿意付更多钱,而且持续降价这一点也让人意外。
It seemed customers would have been willing to pay more, and also the the cutting of prices continuously.
直到今天,同样的存储空间,价格已经降到大约两分或两分三厘了,而刚推出时还是十五分呢。
Even today, I think today it's something like 2¢ or 2.3¢, something like that for the same storage as as as it was 15¢ on launch.
是的。
Yeah.
我觉得这得回到S3的根本目标来看,对吧?
You know, I think part of this goes back to what the goal is for S3, okay?
S3的使命就是提供全球最好的存储服务,这一点很清楚。
And so the mission of S3 is to provide the best storage service on the planet, okay?
同时,我们也考虑到数据增长的趋势,IDC说数据每年增长27%。
And our goal too, is that if you think about the growth of data, IDC says that data is growing at a rate of 27% year over year.
但我得说,我们很多客户的增长速度远超这个数字。
But I have to tell you, we have so many customers that are growing so much faster than that.
对,我正想说,这数字听起来还挺保守的。
Yeah, I was about to say, it sounds pretty low.
我知道,但这只是所有情况的平均值。
I know, like that's But that's an average across everything.
我们有很多客户的增长速度是这个数字的两倍甚至三倍。
We have a lot of customers that grow twice or three times that that rate.
但你想想,所有这些传感器、应用、人工智能产生的数据,还有……
But if you think about that, okay, you think about all the data that's being generated from sensors, from applications, from, you know, AI, from all these different From
还有每天拍的照片,真的每天都很多。
from just taking photos, I mean, every day.
对吧?
Right?
照片。
Photos.
没错。
That's right.
还有你的手机,想想摄像头的分辨率,这些年提升了多少。
Like, you know, and, you know, if you think about your phone too, think about the resolution, and how the resolution of the cameras on the phone have grown.
你就有了这么一个数据海洋,就像Sonar说的那样,对吧?
You just have this, like, kinda what Sonar talked about with the data ocean, okay?
要处理这么多数据并持续增长,就必须让成本控制得足够低。
And in order to have all that data and to grow it, you have to be able to grow it economically.
得让价格低到你根本不用想:‘我现在该删掉哪些数据了?’
You have to be able to grow it at a price point where you don't really think, okay, what data am I gonna delete now?
因为你根本不会缺空间。
Because I'm running out of space.
S3的客户从来不用操心这个问题,原因有两个。
You don't have that conversation with S3 customers because of two things.
第一,我们一直在降低存储成本,或者提升服务性能。
One is, we do lower the price of either storage or the capabilities of what we're doing.
比如,S3表格刚推出一年内,我们就大幅降低了数据压缩的成本。
Like for example, we lowered the cost of compaction for S3 tables pretty dramatically within a year after launching S3 tables.
这还不只是单点降价,而是你整个存储方案的总体拥有成本都在下降。
It's not just that, it's like the overall total cost of ownership of your storage.
我们提供归档存储的功能,对吧?
We give you the ability to tier into archive, right?
存储服务。
Storage.
我们还提供智能分层存储功能:如果你的数据一个月都没被访问过,我们会自动给你折扣,因为我们一直在监控你的使用情况,最多能给你四成的优惠。
We give you the ability to do something called intelligent tiering, which is if you don't touch your data for a month, we'll give you an automatic discount on that data because we're watching your storage and you don't touch it for a month, we'll give you up to 40% discount on that storage.
这完全是动态折扣,你根本不用操心。
And it's like dynamic discounting, so you don't even have to think about it.
我们的目标就是让你能放心地存储所需的数据,因为我们知道这些数据是用来预训练模型的。
And so our whole goal is that you can grow the data that you need to grow because we know that's being used to pre train models.
我们也知道这些数据会被用于微调和各种AI训练后的处理。
We know it's being used to fine tune and do any type of post training of AI.
我们知道你在用它做数据分析。
We know you're using it for analytics.
我们知道你现在和将来都会用它来完成各种不同的任务。
We know you're using it for all these different things either now and in the future.
所以我们的目标是让你能保留数据,并用它来推动你正在做的任何事情——不管是生命科学,还是制造业这类企业。
And so our goal is so that you can keep your data and you can use it in a way that advances whatever the thing is that you're doing, whether it's life sciences or you're an enterprise, you know, in in manufacturing.
对吧?
Right?
不管你有什么需求,数据都该在那里,你可以自由地扩展、保留和使用它。
Whatever you need, the data should be there and you should be able to grow it and keep it and use it any way you want.
是的。
Yeah.
我确实想问问你关于这一点。
I I did wanna ask you about this part.
智能分层功能是2018年推出的。
So there's Intelligent Tiering, which was launched in 2018.
也就是在S3上线十二年之后。
So like twelve years after S3 was launched.
有一件事特别引起我的注意,那就是Amazon Glacier,它早在2012年就推出了,专门用来存那些不需要立即访问的数据,你愿意等一段时间才能取用,可能得等上几个小时。
One thing that really got my attention, Amazon Glacier, which was launched in 2012, so a long time ago, and it's you can store data that you don't need immediate access to, you're okay waiting for some time to get access to it, I think maybe even hours.
刚推出的时候,每GB每月只要1美分,而那时候主流的存储价格大概是15美分,便宜了将近十倍。
When it launched, was only 1¢ per gigabyte per month, which was, again, this was something back then, the going rate for storage was about 15¢, so almost like almost 10 times cheaper.
你们是怎么做到的?
How do you do that?
你们的架构和设计思路是什么?怎么能在用户不急需数据的情况下,把成本压得这么低?
Like, what what is the architecture and thinking behind how you're able to have this trade off of, like, look, if you don't need your data quickly, we can do it a lot cheaper.
你能想象一下,你和工程团队当时在权衡哪些取舍吗?
How how could I imagine the kind of trade offs that you and the engineering team were were were thinking of making?
你知道的,你自己也是工程师,很多工程问题其实都是在限制条件下解决的。
Well, you know, I mean, as you know, I mean, you're an engineer yourself, and as you know, a lot of engineering is about constraints.
对吧?
Right?
做S3最有趣的地方就在于,当你面对各种限制——比如可用性要求,或者存储成本——反而能激发出特别创新的解决方案。
And that is the fun part about working on S is that when you think about constraints, you think about constraints that we have for availability, you consider you think about constraints that we have around, you know, the cost of storage, we start to get really, really creative.
明白吗?
Okay?
在S3里,因为我们从硬盘的硬件底层一直做到整个系统架构,所以能在整个技术栈的每个环节都实现效率优化。
And in S3, because, you know, we build all the way down to the metal of the drives and the capabilities that we have in our hardware, we're able to drive, efficiencies at every single part of our stack, okay?
所以当我们的工程师聚在一起讨论限制条件和设计目标时,比如我们会设定一个每字节的成本目标,然后全力去达成它。
And so our engineers, when they get together and they talk about the constraints, they talk about the design goals, we'll do something like we'll set a target for, you know, the cost of a bite, and we'll drive for that.
我们会把这个目标贯彻到每一个环节中。
And we'll drive for it at every single part of the process.
我们所考虑的环节还包括数据中心本身。
And the part of the process that we are also including is, you know, it includes a data center.
我们的数据中心技术人员,是怎么从硬件和数据中心的角度来运维S3服务的?比如那些物理建筑,就跟我们对S3软件和各层架构所做的那样。
How do our data center technicians be able to operate the service of S3 from a hardware and a data center perspective, like the physical buildings, just like we do the same thing for the software and the layers of S3 itself.
当你能贯通整个技术栈,一直深入到物理设施层面,对每个字节的成本和生命周期都深思熟虑,才能做出像Glacier这样的功能。
And when you have that, when you have that ability to run across the whole stack all the way down to the physical buildings, and we're thinking about so deeply about the cost and the lifetime of every bite, you're able to do things like like Glacier.
你提到一个很有意思的事,S3刚推出的时候用的是最终一致性,也就是说数据最终会到达,但可能不会立刻出现,你可能会有延迟,这种设计带来了很多可能性,也设定了不少限制。
You mentioned something really interesting that when S3 started, it was eventually consistent, which means that, you know, data eventually arrives, that it might not be there and and you might be behind, and there's a lot of things that you can do with this and and it gives you some constraints.
但你提到,团队当初选择这么做,是因为持久性和可用性更重要。
But you mentioned that the reason that the team launched this because durability and availability was more important.
当然,成本也是要考虑的,但在S3最初那个阶段,它还是最终一致性的,这种设计到底带来了哪些好处呢?
And I I assume, of course, cost as well, but during those initial phases, while S3 was eventually consistent, what what kind of benefits does it give to have eventual consistency?
是为了控制成本吗?
Is it a cost constraint?
还是说,从工程角度来说,这样更容易实现高可用性?
Is it just easier to do high availability systems from from an engineering perspective?
从工程角度看,主要的优化目标其实是可用性。
Well, mean, from an engineering perspective, the main optimization was, it was availability.
并不是耐用性,而是可用性。
It was not necessarily durability, but it was availability.
明白吗?
Okay?
如果回过头来看S3最初的架构,我们当时真的把可用性放在了最核心的位置。
So if you take a step back and look at the original design of S3, we were really focused very hard on availability.
所以,咱们先退一步想想。
So let's take a step back, okay?
当你谈到一致性时,指的是对象获取操作能反映出对该对象最新的写入,明白吗?
So when you talk about consistency, it's the property where the object retrieval, the object get, reflects the most recent put to that same object, okay?
如果你想想,S3 系统里哪些部分最直接受影响,其实很多都跟我们的索引子系统有关。
And so if you think about, you know, what parts of the system of S3 that really hits, a lot of it just kinda starts with our indexing subsystem.
S3 的索引子系统保存了你所有对象的元数据。
So if you think about the indexing subsystem in S3, that holds all of your object metadata.
比如对象的名字、标签、创建时间这些信息。
And so that's like its name, its tags, its creation time.
每次你执行获取、写入、列出、查看头部或删除操作——只要是这类 API 调用,都会访问这个索引。
And the index, our index is accessed on every single get or put or list or head or delete, any API call like that.
所有需要去存储系统取回对象的数据请求,都必须经过这个索引。
And so every single data plane request where you go back into our storage system to go get an object goes through our index.
你想想,其实更多请求是经过索引的,因为像 HEAD 请求和 LIST 请求,根本不会真正去访问底层存储系统。
And if you think about it, more requests go through our index in our storage system because for example, it's serving thing like head requests and list requests that don't actually end up going back into our storage system at all.
这些都属于元数据或索引请求。
Those are metadata or index requests.
所以,如果你想想我们的索引系统,里面其实有个存储系统,明白吗?
So, you know, if you think about our indexing system, we have a storage system in there, okay?
这个存储系统是我们索引系统里的一个核心概念。
And that is a really central concept, a storage system in the middle of our indexing system.
所以你们的索引系统是用一个存储系统来支撑的,对吧?
So you the storage system for your index system, right?
没错。
That's right.
所以我们得配置好、调整好这个系统,确保它能兑现我们对可用性和持久性的设计承诺,明白吗?
And so we have to configure and size the system to deliver on our design promise for both availability and durability, okay?
索引系统里的数据基本上是分布在多个副本上的,用的是一种叫投票机制的算法,明白吗?
And so the data is basically in our index system, is stored across a set of replicas and it uses something called It's basically a quorum based algorithm, okay?
这种投票机制对故障的容忍度很高。
And a quorum based algorithm tends to be very forgiving to failures.
所以,如果你想想我们在索引系统里是怎么实现投票机制的,我们首先会把数据存到不同可用区的服务器上。
And so if you think about how we implemented quorum in our index system, we store first from servers that are running in these separate availability zones.
我们这么做的原因是为了避免单一故障域带来的关联影响,明白吗?
And the reason we do that is that it lets us avoid correlation on a single fault domain, okay?
因为单个磁盘、服务器、机架或者可用区的故障,只会波及部分数据,永远不会影响到单个对象的全部数据,甚至不会影响到它的多数副本——这些副本可是分散在大量服务器上的。
And since the failure of like a single disk, server, a rack, a zone, it only affects a subset of data, it never affects all of the data for a single object, or even a majority of the data for a single object, which we have charted across a wide spread of servers.
所以对我们来说,高可用性的核心就在于把所有东西都分散开。
So like this core of availability for us is this idea that we spread everything.
当有请求进来时,它会先到达 S3 的前端,然后我们会把对象在系统里大量缓存起来。
And so, when a comes in, it's coming into the S3 front end, and we just heavily cache objects across our systems.
读取请求进来时,可能会随机路由到某个节点,这就可能造成读取到不一致的数据。
When a read comes in, it could route at random, and you could create a situation where you're creating an inconsistent read.
在索引存储层,我们有投票机制,所以读写操作可能会重叠,但在缓存层不会,因为我们优先保证可用性。
And so when we have quorum at the index storage layer, we can see reads and writes overlap, but in the cache they don't because we're optimizing for availability.
所以让我确认一下第一部分,最终一致性,我说得对吗?你们可以往所有这些分布式节点写入数据,然后随便问其中一个,如果它没有,也没关系,因为数据迟早会一致。
So just so I understand the first part, the eventual consistency, correct me if I'm wrong, that you can just write to all these distributed nodes and you ask one of them, and if it doesn't have it, no problem because it will be eventually consistent.
这样一来,你们就实现了高可用性,因为不需要担心所有节点都必须在线。
You now have high availability because you don't need to worry about all of them being existing.
没错。
That is correct.
这正是AWS第一阶段的做法,它确保了高可用性。
And that's phase one of AWS and it was it it gives you availability.
而现在,你正在解释如何在后台将这种机制转变为强一致性。
And now, you're now explaining how you're able to, behind the scenes, turn this into a strong consistency.
强一致性意味着系统状态是完全一致的,但实现起来很难,因为可能会出现分布式故障等问题。
The strong consistency means that it's guaranteed to have the the whole system's state, which is hard to do because you could have distributed failures, etcetera.
这个复制日志,说实话,我们花了不少时间才搞出来。
And this replicated journal, you know, it took us a while to build, I won't lie.
我们平时很少聊这些内容,你知道的。
We don't talk about this stuff very much, okay?
因为这可是S3的核心秘密。
Because this is kind of the secret sauce of S3.
但我们的工程师们一直在思考:如何在不牺牲可用性的前提下,实现强一致性?
But again, like our engineers who are in the room, they were thinking about how do you deliver on both the strong consistency without compromising availability?
所以我还是得回到这些限制条件上来,好吧?
So I go back to constraints, okay?
在这种情况下,我们其实不再在一致性和可用性之间做取舍了。
So in that case, we were not trading off the consistency and availability anymore.
所以工程师们不得不设计出一种全新的数据结构。
And so the engineers had to come up with a new data structure, basically.
我们在 S3 Vectors 里用的,其实也是一种我们自己发明的新数据结构。
We do this in S3 Vectors basically is a new data structure that we came up with as well.
但你要想想,要在 S3 这种规模下实现强一致性,还不降低可用性,我们只能搞出这个复制日志,明白吗?
But if you think about what we had to invent for strong consistency at S3 scale without relaxing the constraint of availability, is we had to build this replicated journal, okay?
这个复制日志本质上是一个分布式结构,我们把各个节点串起来,这样每次写入进来的时候,都会按顺序经过每一个节点,明白吗?
And the replicated journal is basically a distributed data structure where we're chaining nodes together so that when this write is coming into the system, it's flowing through the nodes sequentially, okay?
所以在 S3 的强一致性系统里,读写操作都会按顺序流经日志中的这些存储节点。
And so a reader write in a strongly consistent system for S3, it flows through these storage nodes in the journal sequentially.
每个节点都会把数据传给下一个节点。
And so every node is forwarding to the next node.
当存储节点被写入时,它们会同时记录下这个值的序列号。
And when the storage nodes get written to, they learn the sequence number of the value along with the value itself.
因此,在后续通过缓存读取时,序列号就能被提取并保存下来。
And therefore, on a subsequent read like through our cache, the sequence number can be retrieved and stored.
这样一来,S3 就实现了强一致性与高可用性,而这一切的核心其实就是这个复制日志。
And so now you have this strongly consistent and highly available capability in S3, and the heart of that is actually this replicated journey.
明白了。
Okay.
但问题是,有什么代价吗?
But what's what's the catch?
一方面,毕竟任何设计都免不了有取舍。
On one on one end because there's always always something with trade offs.
总归是有什么代价的。
You always have something.
所以一方面,业务逻辑会变得更复杂。
So, on one end, you always have more complicated business logic.
那接下来,第二个显而易见的问题就是,如果出现故障怎么办?
And then, I guess the second obvious question is what about failures?
因为在最终一致性的情况下,你不太会担心单点故障。
Because in the case of eventual consistency, you don't worry too much about one failure.
但在这个机制里,如果序列中的某个节点在第一次或之后出错了,该怎么办?
Clearly, in this case, what if a node in the sequence fails either at the first time or later?
系统又是怎么监控和恢复的呢?
Or how does the system monitor this, recover?
因为我觉得,这 probably 是最棘手的部分。
Because that's I guess that's gonna be the tricky part.
对吧?
Right?
我们还实现了一个关键部分,其实就是一种缓存一致性协议。
There's another piece to this puzzle that we implemented, which is, you know, it's basically a cash coherency protocol.
它的核心思路是,我们设计了一种容错机制:在这种模式下,多个服务器可以同时接收请求,即使其中一些失败也没关系。
And the idea is that this is where we built what we think of as a failure allowance, where in this mode, we needed to retain the property that like multiple servers can receive requests and some are allowed to fail.
所以,这其实是把一个复制的日志作为新数据结构,再加上我们实现的这个新的缓存一致性协议,共同提供了容错能力。
And so it's kind of this combination of this replicated journal as a new data structure, plus we implemented this new cache coherency protocol that gave us a failure allowance.
这两者协同作用,才让我们实现了强一致性。
And those two things working in concert gave us this strong consistency.
我也得说,这确实带来了一些实际的代价。
I will say too, this does come at some actual cost.
我正想说呢,工程上没什么是免费的。
I was about to say, like, nothing is free in engineering.
对吧?
Right?
这背后有硬件成本,你可以想象,我们在后台做了不少额外的工程工作。
There's hardware cost in this because you can imagine we're we've done some more engineering behind the scenes.
我记得以前和S3团队的工程师们坐在一起,专门就这个问题展开过讨论。
But I remember sitting in a room with our engineers on S3, and we did a debate on this.
我们认真地辩论过。
We debated it.
我们说,当然有成本。
We said, you know, there's costs.
底层硬件确实会增加开销,我们要把这些成本转嫁给客户吗?
There's like actual costs to the underlying hardware for this, and do we pass it along to customers or not?
我们明确决定不转嫁。
We made that explicit decision not to.
我们当时说,
We said
真的吗?
Really?
是的。
Yeah.
我们决定,上线时就要提供强一致性。
We said that when we launch this, we should launch strong consistency.
要让客户免费使用,任何发到 S3 的请求都能直接生效。
We should make it free of charge to customers, and it should just work for any request that comes into S3.
我们不应该说这功能只适用于某种类型的存储桶之类的。
We shouldn't sort of say it's only available on this bucket type or what have you.
所有发往 S3 的请求都该是这样。
This should be true for every request made to S3.
S3 的理念之一就是,我们怎么才能提供这样的能力?怎么让它成为 S3 的基础组成部分?
And part of that mindset for S3 is like, how can we provide these type of capabilities And how can we make it something that becomes a building block, like part of the building block of S3?
你根本不用去操心它的成本。
And you shouldn't have to think about the cost of it.
顺便说一句,这次发布最让人意外的就是,AWS 突然宣布:所有操作都默认强一致性,而且不额外收费。
This was the very surprising thing of this launch, by the way, that suddenly AWS said, like, okay, everything is strong, existent, it does not cost you more.
从延迟角度看,你的延迟不应该有明显变化。
Latency wise, your latencies shouldn't have changed significantly.
我的意思是,刚上线时肯定会有测量数据之类的,但当时的承诺就是如此。
I mean, I'm sure when you roll out initially your measurements, etcetera, but but that was the promise.
我重读历史的时候简直不敢相信,因为这种事通常根本不会发生。
That was why I I couldn't really believe it when I I I reread history because it typically doesn't happen.
通常来说,强一致性会增加延迟,或者即使不增加延迟,也会提高成本。
Typically, strong consistency does add latency or it increases cost if it doesn't add latency.
总归是有取舍的,听起来你们要么把成本扛下来了,要么成本最终还是追上来了,但这真的非常罕见。
There's always these trade offs, I mean, it sounds like you either swallowed the costs or or costs caught up, but it's it's very unusual, so
说到这一点,对我们来说另一件特别重要的事,虽然之前没怎么聊过,但S3团队一直很关注——那就是正确性。
If I think about that, one of the things that was also very important for us, we haven't really talked about this as much, but we think about it a lot on the S3 team is correctness, okay?
说每个请求都强一致是一回事,真正确信自己做到了,又是另一回事。
So it's one thing to say that you're strongly consistent on every request, it's another thing to know it.
在实现强一致性的时候,我提到过我们新的缓存协议,还有那个复制日志的新数据结构,这些花了不少时间才设计完善。
And so when we built this strong consistency, I talked about our new caching protocol, I talked about this replicated journal as a new data structure, that took a little bit of time to do and to get right.
但在S3的规模下,如果我们不能百分百确定自己做到了强一致,那就不能说我们真的做到了。
But at S3 scale, we could not say that we were strongly consistent unless we actually knew we were strongly consistent, okay?
那这到底意味着什么?
And so what does that mean?
当所有人都用它来支撑所有工作负载时,你怎么在S3的规模下确保这一点?
How do you do that at S3 scale when everybody is using it for every last workload?
事实上,人们选择使用它的一个原因是我们规模庞大,能够把各种工作负载解耦,你可以在 S3 上运行任何东西,但你怎么能确定呢?
In fact, one of the reasons why people use it is because our scale is such that we're decorrelating workloads, and you can run absolutely anything on S3, but how do you know?
梅兰刚才提到,强一致性让人们对 S3 更加信任了。
Mai-Lan just talked about how strong consistency made it so much easier to trust S3.
信任在写代码时同样重要,尤其是现在有了 AI,我们写的代码比以往更多了。
Trust is something that is just as important when writing code, especially when, with AI, we write more code than before.
现在正好聊聊我们的节目赞助商 Sonar。
And this is a good time to talk about our season sponsor Sonar.
AI 对开发者产生了怎样的影响?
What is the impact that AI is having on developers?
我们来看一些数据。
Let's look at some data.
Sonar 发布的一份新报告——《开发者现状报告》显示,82% 的开发者认为有了 AI,他们的编码速度更快了。
A new report from Sonar, the state of developer server report, found that 82% of developers believe they can code faster with AI.
但有意思的是这一点。
But here's what's interesting.
在这项调查中,96%的开发者表示并不太信任AI生成代码的准确性。
In this same survey, 96% of developers said they do not highly trust the accuracy of AI code.
这一点我也深有同感。
This checks out for me as well.
虽然我用AI助手写代码确实快多了,但对它生成的代码,我始终不敢完全放心。
While I write code faster with AI agents, I don't exactly trust the code it produces.
到了代码审查阶段,这个问题就特别突出——所有这些AI生成的代码,都得严格检查安全性、稳定性和可维护性。
This really becomes a problem at the code review stage where all this AI generated code must be rigorously verified for security, reliability, and maintainability.
SonarQube正是为解决这个代码验证难题而设计的。
SonarQube is precisely built to solve this code verification issue.
Sonar在自动化代码分析领域已经领先了十七年,每天分析的代码量高达七千五百亿行。
Sonar has been a leader in the automated code analysis business for over seventeen years, analyzing 750,000,000,000 lines of code daily.
换算下来,每秒超过八百万行代码。
That's over 8,000,000 lines of code per second.
我第一次接触Sonar是在十三年前的2013年,当时我在微软工作,已经有不少团队在用SonarQube提升代码质量了。
I actually first came across Sonar thirteen years ago in 2013 when I was working at Microsoft, and a bunch of teams already used SonarQube to improve the quality of their code.
从那以后我就一直很推崇它。
I've been a fan since.
Sonar 提供了一个关键且独立的验证层。
Sonar provides an essential and independent verification layer.
它是自动化的安全护栏,能分析所有代码——无论是开发者写的还是 AI 生成的,确保在代码进入生产环境前就符合你的质量与安全标准。
It's the automated guardrail that analyzes all code, whether it's developer or AI generated, ensuring it meets your quality and security standards before it ever reaches production.
想免费试用,请访问 sonarsource.com/pragmatic。
To get started for free, head to sonarsource.com/pragmatic.
好了,接下来我们回到 AWS 强一致性的重要性上。
And with this, let's get back to the importance of strong consistency at AWS.
你怎么确定自己实现了强一致性?
How do you know that you're strongly consistent?
正因如此,我们采用了自动推理。
And that is why we used automated reasoning.
什么是自动推理?
What is automated reasoning?
展开剩余字幕(还有 428 条)
对于大多数人来说,除了像S3这样少数领域的从业者,可能都不太熟悉这个概念。
For those of us who are not as familiar with this, which will be most people outside of very few domains like S3.
是的,S3到处都在用自动化推理,这点没得说。
Yeah, it's, I mean, S3 uses automated reasoning all over the place, okay?
自动化推理是计算机科学里的一个专业分支。
And automated reasoning is a specialized form of computer science, okay?
你可以想象一下,要是计算机科学和数学结了婚,生了孩子,那孩子就是自动化推理。
And, girly, if you if you kinda think about if computer science and math got married and had kids, right?
没错,就是自动化推理。
It would be automated reasoning.
你指的是形式化方法吗?
Is formal methods?
对,就是基于形式化方法的,我学过计算机科学,所以这个挺有意思的。
Or That's based on formal exactly I mean, I've I studied computer science, so, yeah, that's fun.
你们实际用的是严谨的形式化方法。
It's actually proper formal methods that you're using.
没错。
That is right.
我们在S3的很多地方都用到了形式化方法,但最早应用的一个地方,就是为了确保每个请求都能实现强一致性。
And we use formal methods in many different places in S3, but one of the first places that we adopted was for us to feel good that we actually had delivered strong consistency across every request.
所以我们做了证明,对吧?
So what we did is we proofed it, right?
我们实际上构建了一个完整的证明过程。
We basically built a proof for it.
然后我们把这个证明集成到了我之前提到的索引区域里,每次提交代码时都会检查。
And then we incorporated our proof on check ins into this index area that I talked about, right?
那里有缓存层,也有存储子层,都是索引功能的一部分。
Where you have your caching and then you have your storage sub layers of the index capabilities.
现在,任何人在修改我们索引子系统的代码时,只要涉及一致性相关的路径,
And so when somebody, anybody is working on our index subsystem now, and then they're checking in code into the code paths that are being used for consistency.
我们都会通过形式化方法验证,确保一致性模型没有倒退。
We are proofing through formal methods that we haven't regressed our consistency model.
你能大概给我们讲一下吗?
And can you just give us a rough idea?
我之前学过的形式化方法,都挺抽象的。
Because the formal methods that I have have studied, they they were pretty abstract.
比如设计语言,怎么定义各种操作符之类的。
The things like designing languages, how to have, like, the the the different operators.
当然,里面也涉及不少数学内容。
And, of course, there are some maths involved as well.
但你们用的形式化方法,具体是针对哪些基本元素?比如服务器、网络这些,还有数据流的模型?
But what are are they, like, primitives, like servers, network, etcetera, and models being built, data flows?
你能用一个最简单的例子,大概讲讲在 S3 里是怎么做形式化证明的吗?
Like, how how can I imagine a simple proof of of something inside S3 roughly at a really high level?
是的。
Yeah.
如果你回到证明的根本目的,其实就是为了确认某件事是正确的,对吧?
I mean if you go back to the fundamental notion of a proof, you are proving something to be correct, okay?
我们使用这些证明的地方之一是一致性,我们通过覆盖所有可能的组合来构建证明,确保一致性模型是正确的。
And so the places that we use these proofs, we use them in consistency, where we built a proof across all the different combinatorics to make sure that the consistency model is correct.
在跨区域复制时,我们也用它来证明数据从一个区域传到另一个区域确实已经抵达。
We use it in cross region replication to prove that a replication of data from one region to another arrived.
在S3的其他多个地方,我们也用它来验证API的正确性。
And we use it in different places within S3 to prove the correctness of API.
在所有这些情况下,我们都会谈到持久性、可用性和成本,但对我们而言, correctness(正确性)同样是一个核心的设计原则。
In all of these cases, we talk about durability, we talk about availability, we talk about cost, but just as strong of a principle, a design principle for us across S3 is correctness.
这里的正确性,指的是API请求或操作本身是否准确无误。
It's a correctness of a thing, an API request, an operation as it were.
对我们来说,关键在于:证明只需做一次,但每次提交代码、每次处理请求时都要重新验证,这样才能确保你真正做到了你承诺要做的事。
And the key thing for us too, is that you wanna just proof it once, you wanna proof it on every single check-in and you wanna proof it on every single request so you can verify, you can validate and verify that you are doing in fact what you say you do.
我认为,在某个规模下,数学必须成为我们的保障,对吧?
And I think for us, at a certain scale, math has to save you, right?
因为在足够大的规模下,你不可能穷尽每一个边缘情况的组合,但数学可以。
Because at a certain scale, you can't do all the combinatorics of every single edge case, but math.
在 S3 的规模下,数学真的能帮上大忙。
Math can save you and help you on this at S3 scale.
所以我们把形式化方法用在了 S3 的很多地方。
And so we use formal methods in many different places of S3.
我们还有一些研究论文。
We have some research papers too.
我可以发你几篇论文的链接,里面详细讲了这些内容。
I can send you some links to some research papers where you talk about them.
是的。
Yeah.
一定要发给我,我们会把链接放到节目笔记里,方便大家查看,我觉得这些内容特别有意思。
Please please do, and we will and we will put it in the show notes below so anyone can check it out because I think it's it's really interesting.
我觉得很多初创公司,甚至基础设施类的初创公司,还很少关注形式化方法,但听到你们一直在做这种持续验证,我感觉特别安心。
I feel formal methods are not really a thing in a lot of startups and even infrastructure startups yet, but it sounds very reassuring to me to actually have an ongoing proof of that.
说到这个,我想问一个相关的问题——关于持久性。
And speaking of which, I want to ask about one thing that is related to this, durability.
Amazon S3 的持久性承诺非常高,我记得是十一个九,我一开始还特意查了两遍,因为在后端系统里,提到三个九的可用性就已经很厉害了,四个九的可用性都很难实现,再往上成本就飙升了,我从来没听说过有哪个系统敢承诺十一个九的持久性。
Amazon S3 has very very high durability promises, I think it's 11 nines, which I had to do a double check on because in back end systems whenever you say three nines it's like, when you say four nines of availability, we're not talking durability, availability four nines is already hard to achieve and beyond that it just gets very expensive and I have never heard of 11 nines of durability.
不过这里说的是持久性,不是可用性。
Now this is durability and not availability.
我之前公开分享这个数据时,有人问了我一个问题,我自己也在想:你怎么能证明这一点?不只是在理论上,而是你们现在存储了五千亿亿个对象,按这个规模,光是靠概率,理论上也该丢掉一些数据了,你们怎么确保没丢呢?
One question question that I I got when I when I shared this that publicly, what people one thing people were asking and I was also thinking, how can you prove that, not just in a formal way, but you're now storing as you said 500,000,000,000,000 objects, which is now large enough that just by this durability promise, you should be you might be losing some of them.
你们会不会实际去检查真实数据,而不仅仅是靠理论证明?
Do you actually, like, validate it on the actual data as well on outside of the proof?
因为我知道理论证明里会假设硬件故障率,但这些假设未必完全符合现实。
Because I assume in the proof you will have assumptions on hardware failure rate, which might or might not be not be true.
所以我想问的是,在 Amazon S3 这个层面,你们怎么验证自己是否真的兑现了持久性承诺?具体是怎么做的?
So my question is that at Amazon S3 level, when you are able to look at the, are we living up to, for example, our durability promise, how do you go about that?
你们发现了什么结果?
And what are your findings?
是的。
Yeah.
我们花了大量时间讨论索引子系统,因为它是跟一致性直接相关的部分。
So we just spend a lot of time talking about our index subsystem because that is the subsystem that is related to consistency.
但说到持久性,其实你需要从S3架构的各个层面来看,而我们最关注的是存储层。
But when you think about durability, I mean, you think about it all, you know, on different levels of the S3 stack, but we really think about it in the storage layer.
在存储层面上,你面对的是这套设计所承诺的可靠性保障。
And so if you think about it in the storage layer, you have this design, this promise of the design care.
而这个保障背后,是一系列技术的组合。
And underneath that is a combination of things.
它不仅是软件层面的,还包括我们在S3中所有数据的物理分布方式。
It's software, but it's also the physical layout of where our data is across everything that we have in S3.
我之前提到过,我们的硬盘和服务器被安置在机架上,机架又放在数据中心里,我们总共有上千万块硬盘。
And, you know, one of the things that I talked about is that we have disks and servers which sit in racks, which sit in buildings, and we have tens of millions of these hard drives.
我们有数百万台服务器,分布在38个区域的120个可用区中。
We have millions of servers, and we have a 120 availability zones across 38 regions.
是的。
Yeah.
一个可用区指的是两个物理上完全独立的地点,只是为了
And one availability zone is like, two availability zones are two physically separate locations, just to
说清楚一点。
be clear.
它们在物理上是分开的,有时候相隔还挺远。
They're physically separate, and sometimes they're a ways away from each other.
在我们的一些区域里,可用区不止三个,我是说,这些可用区为我们提供了不同的域,也就是故障域。
And in some of our regions, we have more than three avail I mean, the availabilities loans gives us a different domain, a fault domain.
如果要谈持久性,对我们来说最重要的其实是审计系统。
If I were to think about durability, I think the most important thing for us is our auditors.
你想想这个分布式系统,我们之前聊过上传和下载,后台其实有成百上千个微服务,每个都专门负责一两件事,明白吗?
So you think about a distributed system, we talked about the put and the get, we have many, many, many microservices that are all doing one or two things very well in the background, okay?
所以我们有各种各样的健康检查机制。
And so we have many different varieties of health checks.
但同时我们也有修复系统和审计系统。
But we also have repair systems and we have auditor systems.
我们的审计系统会遍历整个集群,逐字节检查数据。
And our auditor systems go and they inspect every single bite across our whole fleet.
一旦发现需要修复的迹象,修复系统就会自动介入。
And if there are signs that there is repair needed, another repair system will come in place.
在分布式系统中,这些全部都是微服务,彼此松散协作,通过标准化的接口进行通信。
And these are all, in the world of distributed systems, these are all microservices working together, loosely correlated, but communicating through well known interfaces.
目前,这套系统已经包含超过两百个微服务,全部都隐藏在一个S3区域端点后面,其中相当一部分专门负责数据持久性保障。
And so that collection of systems, which are over 200 microservices now, that all sit behind one S3 regional endpoint, and a fair number of those subsystems, those microservices, are all dedicated to the notion of durability.
它们会去检查、记录并反馈结果。
So, will go and check and log and report back.
所以我的理解是,在S3的任何时间段里,都有人或系统能回答过去一周、一个月、一年的数据持久性情况,对吧?
So, do I understand correctly that in any given timeframe at S3, someone or some people or some systems can actually answer the question of what is our durability the past week, month, year, and so on.
是的。
Yes.
很好。
Okay, great.
所以,你们实际上能验证自己的持久性承诺,确认数学模型是否准确。
So, you can actually verify your durability promise that check if the math is mapping.
是的。
Yes.
我们的设计之一就是,无论何时——就像今天你我这场对话中,服务器都在不断出故障,因为服务器本来就会坏。
And, you know, part of our design is that at any given moment, in this conversation that you and I have had, just today, we're having servers fail because servers fail.
因此,我们在 S3 中构建的一切,都是基于一个前提:服务器会出故障。
And so what we are building and what we've built in S3 is an assumption that servers fail.
所以,我们的很多系统一直在做一件事:首先检查任何故障可能影响哪个节点,会对某个字节造成什么影响,然后自动触发相应的修复机制。
And so a lot of our systems are always, know, first of all, they're checking to see, you know, where any failure might hit an individual node, how does it affect a certain byte, what repair needs to automatically kick in place.
这套系统其实一直在后台默默运行,而它和用户发起的读取或写入操作完全是两回事。
And so this system is constantly moving behind the scenes, if you will, while And that is a completely separate thing from the get in the put.
用户看到的只是读取和写入操作。
The get in the put is what the customer sees.
在底层,还有一个庞大的世界,专门负责如何在大规模下管理每一个字节。
There's this whole universe under the hood of how do we manage the business of bytes at scale.
我只是在想,对我们这些构建中等规模系统的工程师来说,虽然比起S3可能算小了,但一旦出故障,影响还是挺大的。
I'm just thinking because for a lot of us engineers who are building like moderately sized systems, I'll say compared compared to s three, they can already be big, but a failure is is a big deal.
比如,机器又宕机了。
Like, you know, like a a machine going down again.
我有个小副项目,存储空间满了,就开始报错。
I have a small side project and my storage filled up and I started to get errors.
这事儿挺严重的,因为我很少遇到这种情况。
And this is a big deal because it rarely happens to me.
这三年来还是第一次。
This is the first time it happened in three years.
是的。
Yeah.
但我明白,在你们这种规模的业务里,或者在S3这种级别,这种事每天都在发生。
But I understand that in your business or or when you work at S3 scale, this is just every day.
问题不是会不会发生,而是多久发生一次,你们怎么应对。
And and the question is not when, it's just how often, how do you deal with it.
这简直就是另一个世界。
I guess it's it's a different world.
确实不一样,关键是要真正考虑到关联性故障。
It is a different world, and the the trick is to really think about correlated failure.
明白吗?
Okay?
不管在什么规模下考虑可用性,真正会拖你后腿的都是关联性故障。
So if you're thinking about availability at any scale, it's the correlated failure that'll get you.
那什么是关联性故障?
And what is a correlated failure?
嗯。
Okay.
这其实特别有意思。
So that's super interesting.
比如我之前说的最终一致性,还有投票机制,你记得吧?
So if you think about what I talked about with, you know, eventual consistency, we talked about quorum, okay?
投票机制可以容忍单个节点故障,但如果所有节点都出问题了,比如它们都在同一个可用区或者同一机架上,那你的底层存储可用性就真要出大问题了,明白吗?
And quorum is okay for one node to fail, but if all of the nodes go south, for example, and they're in the same availability zone or on the same rack, then you're really gonna be messing with your availability of the underlying storage, okay?
你刚才说的缓存容错能力就全没了,因为它们全都一块儿挂了。
You just lost your failure allowance that I talked about with the cache because they all fail together.
所以,在考虑系统可用性时,相关性故障是绝对不能忽视的关键问题。
And so like a correlated failure is an incredibly important thing to think about when you're thinking about availability.
因此,在设计时应对相关性故障,我们需要思考的是:这些工作负载是如何暴露在不同层级的故障风险下的?
And so when we're designing around correlated failures, the thing is that we have to think about is like, do we expose or how are those workloads exposed to different levels of failure?
当你通过 PUT 请求上传一个对象到 S3 时,我们会把这个对象复制多份,明白吗?
So when you upload an object to S3 with a PUT, we replicate that object, okay?
我们不会只存一份,而是会存好多份。
We don't just store one copy of it, we store it many times.
这种复制机制非常重要。
And that replication is important.
它对数据持久性很关键,但更有趣的是,它对可用性也同样重要。
It's important for durability, but what's interesting about it, it's also important for availability.
因为如果某个关联故障区域出问题了,比如整个可用区瘫痪,数据在其他地方还是有备份的。
Because if any of those correlated failure domains fail, like if a whole AZ fails, there's still a copy somewhere else.
就算某个可用区、机架或者服务器出了故障,数据依然能在别处访问到,明白吧?
And the data is still available somewhere even though an availability zone has failed or a rack has failed or a server has failed or so forth, okay?
所以,无论是物理设施还是逻辑架构,如何应对关联性故障,这对S3的可用性和持久性都至关重要。
And so that idea of how do you manage and design around correlated failures with both our physical infrastructure, as well as our logical infrastructure, is super important for S3 for both availability and durability.
我们还会考虑一种叫崩溃一致性的机制。
We also do things like we think about something called crash consistency.
说实话,我现在都能没完没了地讲下去,你得随时喊停才行。
I mean, currently, you can tell I can go on and on about this, so you just have to stop me.
不用。
No.
但这些内容才真正有意思。
But this is the interesting stuff.
好。
Alright.
所以,崩溃一致性这个概念就是,你构建的任何系统,在遭遇突然中断后,都必须能恢复到一个一致的状态。
So the whole idea of crash consistency is that a system, any system that you build, it should always return to a consistent state after a fail stop failure.
如果你能思考系统在故障发生时可能到达的所有状态,始终假设故障一定会出现,那自然也会默认一致性和可用性必须保证,这样你就能设计出各个微服务,让它们在S3这样的底层能力上协同工作。
And if you can like do things like reason about the set of states that a system can reach in the presence of failure, and you just always assume the presence of failure, then you also assume the presence of consistency and availability, then you just design all of these different microservices to all work together in an underlying capability like S3.
这正是我们工程师每天在做的事情。
But that's what our engineers do.
他们天天琢磨崩溃一致性的问题。
They think about like crash consistency.
他们也时刻关注相关性故障。
They think about correlated failures.
他们还会考虑容错机制、缓存这些事。
You know, they think about failure allowances and caches.
对吧?
Right?
我们工程师每天投入的,正是这些深入的分布式系统工作。
And it's it's all that deep distributed system work that that our engineers come in every day to work on.
咱们聊聊你是怎么看待容错设计的?
Can we talk about how you think about failure allowances?
因为其实其他公司也有错误预算这个概念。
Because again, there there is a concept of error budgets outside in other companies as well.
我觉得那玩意儿管得比较松,而容错设计可是你们的核心业务。
I feel it's a bit like loosely handled, whereas I feel this is kind of your bread and butter.
那到底什么是容错设计?你们怎么衡量它?要是超支了或者用过头了,又该怎么办?
So what is a failure allowance and how do you measure it, and what do you do if you if you overstep it or overspend it?
对。
Yeah.
我的意思是,我觉得故障容忍这个概念就是必须得有,就像你不得不接受它一样。
I mean, I think that the idea of a failure allowance is want to have it, like you have to have it.
如果你假设系统永远不会出故障,那你实际遇到的日子会非常难熬。所以我们得考虑故障容忍,但最重要的,我们先聊聊缓存里的故障容忍问题。
If you assume for enough, you know, that you'll never have a failure, you will you'll actually have a very bad day for your And so we account for failure allowances, but the most important thing is, let's just talk about the failure allowance in our cache.
那我们要怎么管理它呢?
So how do we manage that?
我们是通过合理配置容量来确保你根本察觉不到它的存在。
Well, we manage it in such a way that you'll never experience it, because we size it, right?
当你在调整缓存大小时,必须确保底层能力和硬件始终可用,就像我之前提到的那些分布式子系统和微服务,它们都在后台默默运行。
And if you're sizing the cache and you're making sure that the underlying capabilities and the hardware are always there, and we have, like I talked about those distributed subsystems, those microservices that are all in our operating under the hood.
我们有大量这样的服务,专门用来监控各项指标。
We have a ton of them that do nothing but just track metrics.
对吧?
Right?
我们的缓存大小完全依赖于这些指标和系统健康状况。
And like, you know, the sizing of our cache is all related to the metrics and then Health.
还有底层系统的规模。
The size of our underlying system.
所有的指标。
All the metrics.
没错。
Yeah.
是的
Yeah.
没错
That's right.
在S3上运行的一个巨大优势在于,我们的系统规模庞大,有着层层叠叠的架构,你知道的。
And so one of the really big benefits of running on S3 is because our system is so huge, you have these massive, you know, layers, right?
这些庞大的层级都在处理相关故障和容错机制。
And the massive layers are all managing things correlated failures and failure allowances.
由于S3的规模如此之大,任何运行在其上的应用都能从中受益。
And because they are so huge at the scale of S3, any application that's sitting on top of S3 gets the benefit of it.
咱们先暂时放下S3,聊一聊我首次组织的一个特别活动——与Statsig联合主办的《务实者峰会》。
Let's take a break a minute from S3 to talk about a one of a kind event I'm organizing for the first time, The Pragmatic Summit in partnership with Statsig.
你有没有想过,能见到《务实者工程师》播客里的那些特邀嘉宾,还有来自前沿科技公司的专家,一起探讨在AI新时代下,软件开发中哪些做法有效、哪些行不通?
Have you ever wanted to meet standout guests from the Pragmatic Engineer podcast plus folks from cutting edge tech companies and learn about what works and what doesn't in building software in this new age of AI.
欢迎二月来旧金山,参加这场为期一天的特别线下活动。
Come join me on live in February in San Francisco for a very special one day event.
Pragmatic Summit 汇聚了众多行业传奇和往期播客嘉宾,比如劳拉·塔乔、肯特·贝克、西蒙·威利森、黄智、马丁·福勒,还有很多人。
The Pragmatic Summit features industry legends and past podcast guests like Laura Tacho, Kent Beck, Simon Willison, Chip Huynh, Martin Fowler, and many others.
我们还会分享 Cursor、Linear、OpenAI、Ramp 等团队如何打造前沿产品的内部故事。
We'll also have insider stories on how engineering teams like Cursor, Linear, OpenAI, Ramp, and others build cutting edge products.
现场还设有圆桌讨论,精心安排的观众群体都彼此志同道合,大家乐于交流互动,我希望这能让这个活动格外特别。
We'll also have roundtables and carefully curated audience where everyone and everyone is interested to meet and chat with, something I'm hoping will make this event extra special.
席位有限,想参加的话可以去 pragmaticssummit.com 申请。
Seats are limited, and you can apply to attend at pragmaticssummit.com.
所有演讲都会录制并分享,付费订阅者还能提前观看,这也是对你们额外支持的一点心意。
Talks will be recorded and shared, and paid subscribers will get early access afterwards as well as a thank you for your additional support.
我期待在现场见到你们很多人,对这个活动我真的很兴奋。
I hope to meet many of you there, and I am so excited about this event.
现在我们回到 S3,聊聊这个服务的庞大规模。
And now let's jump back to S3 and the massive scale of the service.
为了让大家感受一下在这样的组织里当工程师、当技术主管是什么体验,我读一段杰出工程师安迪·沃菲尔德说过的话——我直接引述他的原话:我刚入行的时候,对构建大规模商业软件有个很天真的想法,觉得无非就是写代码而已。
To get a sense of what what what the reality is like working as an engineer, an engineering leader inside an organization like this, I read a quote from distinguished engineer Andy Warfield, who said, I'm just quoting what he said, early in my career, I had this sort of naive view about what it meant to build large scale commercial software, that it was basically just code.
我在做S3的时候很快就意识到,代码根本离不开团队的组织记忆和运维实践,还有整个系统的规模。
The thing I realized very quickly working on S3 was that the code was inseparable from the organizational memory and the operational practices and you know the scale and and the scale of the system.
你已经在S3待了十多年了,你是怎么看待这个庞然大物的?几百个微服务,数据量大到难以想象——除非你想象硬盘堆到空间站那么高。
Since you've you've now been more than a decade in S3, how do you think of this this beast, this this really complex system, hundreds of microservices, data that is hard to fathom, you know, unless you think of the hard drive stacking all the way to the space station?
你们这些工程师是怎么应对这种复杂性的?
And how do you and engineers kind of wrangle this?
说实话,这确实有点让人望而生畏。
Because it does feel a bit intimidating, I'm not gonna lie.
我觉得这一切归根结底还是靠团队的文化和那份执着。
Well, I think so much of this just comes back to the culture and the commitment on the team.
我确实在S3工作了很长时间,对这个团队的工程师们充满敬意。
And yeah, I've worked on S3 for a very long time now, and I have such deep respect for the engineering community on S3.
说实话,这不仅适用于S3,我们整个数据与分析平台的每个服务都是这样——S3的工程师每天都在为数据的持久性、可用性和一致性全力以赴。
And honestly, I mean, this is true for all of the services in our data and analytics stack, but we have engineers on S3 and they come in every single day with this deep commitment to the durability and availability and the consistency of your bite.
所以我们讨论的问题特别有意思,因为团队里有很多人,甚至有些刚毕业不久。
And so the type of conversations that we have are so interesting because we have people, and really, you know, these are people who are early out of school.
这些人一直在做S3的相关工作。
They're people who've been working on S3.
我们有一些工程师,已经在S3上干了十五年。
We have engineers who've been working on S3 for fifteen years.
从S3的创意和早期开发到现在,中间各种情况都有,你得面对一种张力:一方面,你得对底层代码保持极度谨慎,对吧?
Everything in between, creativity and the invention of S3, like you have this tension, which is like, on one side you're like, you have to be very conservative with tree, right?
另一方面,我们有个核心工程原则,叫‘尊重过往’。
And on the other hand, I mean, we have this principle engineering tenant called respect what came before.
这是亚马逊的工程准则:如果某个东西已经稳定运行了很多年,你就得尊重它。
And that's an Amazon engineering tenant, which is if it has worked for many, many years, you have to respect that.
但同时,还有另一个原则。
But then there's also this tenant.
这两个原则彼此有点冲突,但也正是这种张力让工作特别有意思。
These two tenants are a little bit in tension with each other, which is kinda what makes it so fun.
亚马逊的另一个工程原则叫‘技术无畏’。
Amazon engineering tenant is called be technically fearless.
我相信,S3 的工程师在尊重既有成果方面做得特别出色。
And I believe that the S3 engineers are just amazing at this, at respecting what came before.
因为当我们为 S3 添加新功能时,必须保留它的核心特性——比如高持久性、高可用性这些关键表现。
Because if we build new capabilities in S3, we have to maintain the properties, the traits of S3, which is adjust works, you get that durability, availability, etcetera.
但同时,我们也必须保持技术上的无畏精神,因为能够支持条件查询、原生集成 Iceberg 或向量数据,意味着我们在原有存储基础上不断拓展,帮助客户构建当下和未来所需的各类应用。
But at the same time, we have to be technically fearless because our ability to go into the world of conditionals, our ability to go into the world of native support for Iceberg or for Vectors means that we are extending this this foundation of storage in a way that helps customers build whatever application they need now and in the future.
所以,当我想起我们的 S3 工程团队时,我觉得他们每天都在践行这种双重精神。
And so that combination of the two things, that is sort of when I think about our S3 engineering team, I think they come in every day and they embody that.
回到 S3 从非结构化到结构化数据的演进,你之前提到,Hadoop 和数据仓库曾是客户在 S3 上的主要用例,后来你们发现很多大客户都在这么用,于是你们自己也开始往结构化数据方向发展。
Now, going back to the evolution of S3 from unstructured to structured data, you were mentioning how Hadoop, the data warehouse, what what was a big use case where customers started to use it on top of S3, and then at S3 you noticed, you're like what a lot of customers or some of your biggest customers doing, and then you kind of built it yourself with more structured data.
接着就有了 S3 表,再后来是向量功能。
And then S3 tables came along and then Vectors.
你能再详细说说 S3 是怎么一步步演进的吗?
Would you mind sharing a little bit more on on how you evolve S3?
因为这也是很多人关心的问题——S3 到底算完成了吗?
Because this was another question that when I asked people about what they like to know about S3, one of the question was like like, is it done?
它完成了吗?
Is is it finished?
还是说它还在不断演进?
Or or is it still evolving?
大家都觉得 S3 已经能存任何东西了,对吧?不管是哪种对象、哪种二进制数据,那还有什么新东西可加的呢?
Because there is this notion that S3 can store anything already, right, like any object, any blob, what new thing is there?
但事实上,我们一直在推出很多新功能。
And yet, we have a lot of new things.
是的。
Yeah.
如果你回过头看看,比如 Parquet 这种格式的兴起,对吧?
And if you kinda go back in time a little bit and you think about, you know, the rise of Parquet, okay?
Parquet 数据在 S3 上开始流行,大概是 2020 年左右。
So the rise of Parquet data in S3 started about 2020.
从那以后,越来越多的人开始把表格数据存到 S3 里。
And we started to see more and more people store their tabular data in S3.
而Iceberg提供的,其实是Hive的替代方案。
And if you think about what Iceberg provided, it provided a replacement for Hive.
明白吗?
Okay?
想想Hive和Hadoop,Hive本质上是让文件系统能访问S3里的非结构化数据。
So if you think about Hive and Hadoop, Hive was basically giving your file system access into S3 unstructured storage.
而Iceberg则为你的Parquet数据提供了类似的表格化访问能力,还包括了压缩和所有相关的表维护功能。
Iceberg is giving that Iceberg that tabular access, including the compaction and all the table maintenance that goes along with it, into your Parquet data.
我甚至觉得,未来所有的结构化数据都会存放在S3里。
And I actually think that the world's data for tabular data is going to live in the future in S3.
就拿上周Supabase发布的功能来说吧,他们宣布自家的PostgreSQL数据库现在可以直接把写入操作发到S3的表格里。
And if you just think about the launch that, for example, Supabase did last week, Supabase announced that their Postgres database is now gonna Is just gonna do secondary rights directly into an S3 table.
就像他们之前为向量搜索开发的PostgreSQL扩展一样,现在也会直接对接S3中的向量数据。
Just like their Postgres extension for vector is going to integrate directly with S3 Vectors.
如果整个数据库世界、整个数据源体系,都直接把数据写进S3表格,那对整个数据生态意味着什么?
And so if the world of database, if the world is data as a source, if you will, goes directly into an S3 table, what does that mean for the world's data?
好的,SQL 作为数据领域的通用语言,这一点我们都清楚。
Okay, so SQL, as we know, is a lingua franca of data.
而且全球的大型语言模型都训练于数十年积累的 SQL 数据。
And the world's LLMs have all been trained on decades of SQL.
因此,
And therefore,
所有这些都离不开它。
all it.
还有 Python。
Python.
SQL 和 Python。
SQL and Python.
Python 以及现有的各种工具。
Python and the stuff that's already out there.
所以你想想,我们现在有大量 AWS 客户对 S3 的 API 非常熟悉,这个 API 本身也很简单,但现在你可以直接用 SQL 来操作 S3 里的数据了。
And so if you think about this, you know, we have many, many AWS customers who know the S3 API pretty darn well by this point, it's pretty simple API, but now you have the ability to interact with data in S3 through SQL.
这意味着你不需要去开发云应用,也不用懂S3,只要会SQL就够了。
And what that means is that you don't have to be, you know, somebody who's building cloud applications or know S3, you just need to know SQL.
这指的是S3表,对吧?
And this is with S3 tables, right?
就是S3表。
With S3 tables.
你可以直接对S3表写SQL语句。
And so you can just write SQL into an S3 table.
不管是AI代理还是人类,你都是把数据的通用语言,作为S3表的内置功能引入进来了。
And whether you're an AI agent or a human, right, you're introducing the lingua franca of data as a native property of S3 with S3 tables.
我觉得未来几年,这种做法一定会迅速普及。
And I think you're just gonna see that take off in the upcoming years.
你们最新推出的是S3 Vectors。
And your latest launch is S3 Vectors.
能聊聊打造像向量这样的新数据基础组件,需要哪些条件吗?
Can can you share a little bit what it takes to build a new data primitive like Vectors?
幕后具体是怎么运作的?开发周期多长?各个部分是怎么衔接的?在推出这样的功能时,遇到了哪些工程上的挑战?
Just just behind the scenes, how long it takes, how the seams comes together, and and maybe what are some engineering challenges of launching some something like this.
我们说的向量,其实你用大模型的时候都会生成嵌入向量,它本质上就是一个向量,得存起来,还得能搜索,以前都得靠专门的向量数据库,还得加各种向量索引之类的。
Again, we're talking about Vectors, right, so, like, you can use use embeddings whenever you have LMs, you create an embedding, it's a vector, you wanna store that somewhere, you will need to search on it, there's specialized vector databases, there's specialized vector additions, etcetera.
所以我猜,S3 向量就是很好地支持了这些功能?
So, I'm assuming this is the function that S3 Vectors supports very nicely.
是的,现在很多人用向量数据库,就像以前很多人把表格数据都塞进传统数据库里一样。
Yeah, and you know, I mean, today, a lot of customers use vector databases, just like back in the day, a lot of people put their tabular data in just databases, okay?
他们只是借数据库的结构来查询数据,但其实根本不需要数据库,只是因为没别的选择才这么干。后来 S3 出现了。
And they just use the structure of the database in order to take advantage of being able to query their data, but they didn't really need to use a database, they just put it in a database and then S3 came along.
我们借助 Apache Parquet 这类开放格式,把结构化数据直接存到 S3 里,就是这么做的。
And then we introduced this way, you know, with the help of open formats like Apache Parquet, and being able to store that structured data in S3.
现在我们对向量也是同样的思路。
That's kinda what we're doing with vectors right now, okay?
你想想,向量本质上是一种定制化的数据类型。
And if you think about vectors, vectors are basically a bespoke data type.
说到底,向量就是一个特别长的数字列表。
A vector at the end of the day is a very, very long list of numbers.
向量其实早就存在了,也用在向量数据库里很久了,但最近几年,随着你提到的嵌入模型兴起,它们才真正开始在数据领域大放异彩。
And vectors have been around for a long time and they've been in vector databases for a while, but they really kinda took off in people's data worlds in the last couple of years with the rise of, as you said, the embedding models, okay?
如果退一步看,数据领域有个特别有意思的地方:你得先了解你的数据,才能真正理解它,对吧?
And so if you take a step back and you think about one of the great ironies of data, it is that you have to know your data to know your data, right?
你得知道数据的结构,知道字段类型,知道数据存哪儿。
You have to know what your schema is, you have to know what the data types are, you have to know where it is.
随着数据湖变成数据海洋,你越来越难搞清楚自己手里到底有什么数据。
And as these data lakes become data oceans, you have this situation where it gets harder and harder to know what's in your data.
对吧?
Right?
而嵌入模型的妙处就在于,它能帮你理解数据,让你不用自己去琢磨数据的含义。
And the beautiful thing about embeddings is that embedding models will understand your data so that you don't have to understand your data.
这些嵌入模型把对数据的语义理解,最终转化成了一种向量形式。
And the format that these embedding models puts this semantic understanding of your data is in fact a vector.
当我们和客户交流时,他们对这些嵌入模型越来越强大感到非常兴奋,都想把越来越多的语义理解应用到他们的底层数据上,不管是非结构化数据,还是存在存储里的数据。
And so when we talk to customers and they're so excited about how these embedding models are getting better and better, they want to apply more and more basically semantic understanding to their underlying data, whether it's unstructured or that they have in storage.
所以他们希望存储数十亿个向量。
And so they kinda wanna store billions of vectors.
不过我插一句,你说他们想理解数据,我纠正一下——举个例子,你有一堆文本数据,或者一些图像数据,很多客户、团队都希望写查询,比如‘能不能找一张看起来像小狗的图?’或者‘能不能找到一篇包含这些内容的文章?’
But but just to say, when they wanna you say they wanna understand, just correct me if I'm but hypothetically, you have a bunch of text data or maybe some image data, and you're saying that a lot a lot of people, customers, teams, they would like to write queries to say like, hey, can you find an image that looks like a puppy, or can you find an article that contains this or this?
而嵌入模型确实很擅长做这些事,但你得实际去生成这些嵌入,搭建整个系统等等。
And and embeddings are, as we know, are great for that, but then you need to actually create the embedding, build the system, etcetera.
对吧?
Right?
没错。
Yeah.
你说得一点都没错。
And like exactly what you're saying.
你想啊,向量能做的事太多了,想想一家公司拥有的所有数据,你在业务中或生活中积累的知识,从来都不是像数据库那样整齐地排成行和列的。
I mean, if you think about what Vectors can do, if you think about all the data that a given company has, your knowledge across your business, or your knowledge across your life isn't organized into rows and columns like a database.
都在PDF里。
It's in PDFs.
也在你的手机里,对吧?
It's in your phone, right?
还在客服的语音录音里,这些录音真实记录了客户对与你互动的感受。
It's in audio customer care recordings, which capture the sentiment of how a customer actually feels about their interaction with you.
还有白板上的内容。
It's whiteboards.
到了今天结束时,这块白板早就写满了想法,而这些想法还散落在几十个系统的文档里。
By the end of this day, this whiteboard is totally filled up with ideas and it's in documents across dozens of systems.
所以不是你没数据,而是你数据多得不得了。
And so it's not that you don't have data, you have tons of data.
但问题是,你很难搞清楚这些不同格式的数据里到底有什么,而AI模型正好能帮上这个忙。
But understanding what data you have across all of those different formats is a real problem and it's one that AI models can help you with.
过去一两年里,这些AI模型的能力提升得飞快,但我们得有个地方来存放数十亿个向量,也就是数十亿份语义关系的理解。
And so the capabilities of those AI models have gotten so much better in the last eighteen to twenty four months, but we needed a place to put billions of vectors, billions of the semantic understanding of relationships.
我们开发S3就是为了这个目的。
And that's what we built S3 for.
最先进的嵌入模型,加上在S3上存储向量的能力,这一点非常关键。
The state of the art embedding models combined with the ability to have vectors across S3 is like a really important part.
它并不是一个数据库。
And it's not a database.
我是说,S3的成本结构和规模本身就适合做向量存储。
I mean, it's the cost structure and scale of just S3, but it's for vector storage.
那我理解得对吗?
And then do I understand that?
你们得从头开发新的底层机制来存储这些数据吗?
Did you need to build new primitives to store this?
我是说,得深入到最底层,搞清楚具体怎么实现,还是说你们只是在现有的对象存储这些基础组件上搭建的?
Like, going down to the metal, figuring out exactly where we do this, or did you build it on top of your existing, you know, like, again, existing primitives of all, blob stories, etcetera?
这其实是一个全新的底层机制。
It's actually a new primitive.
所以我们之前聊过S3表。
And so, you know, we had talked about S3 tables.
S3表是基于对象构建的,因为那些单独的Parquet文件,说到底也就是个对象。
S3 tables is building on objects, because those individual Parquet files, at the end of the day, they're an object.
向量就完全不一样了。
Vectors totally different.
所以对于向量,我们设计了一种全新的数据结构和数据类型。
So with Vectors, we built a new data structure, a new data type.
而且你会发现,当你在高维空间里搜索最近的向量——其实就是向量空间——找最近邻通常特别困难。
And, you know, it turns out that when you're building vectors, searching for the closest vector in a very high dimensional space, which is basically vector space, it's often really hard to find the nearest neighbor.
所以在数据库里,你基本上得把所有向量一个个比对一遍。
And so you basically, in a database, you have to essentially compare every vector in a database.
这通常成本高得吓人。
And that's often like super expensive.
所以我们用S3的做法是,既然不是把所有向量都存在内存里,而是存在庞大的S3集群上,我们还是得保证极低的延迟。
And so what we do in S3 is because we aren't storing all of our vectors in memory, we're storing it on our fleet of S3, very large fleet, we still need to provide a super low latency.
上周发布时,我们的向量空间在热查询下能实现一百毫秒甚至更短的响应时间,这其实已经很快了。
And in our launch last week, we were getting about a hundred milliseconds or less for a warm query to our vector space, which is actually pretty fast.
虽然算不上数据库级别的速度,但已经相当不错了。
It's not database fast, but it's pretty fast.
我们是通过预先计算一批向量邻域来实现的,你可以把它们想象成向量的聚集区。
And the way that we do that is we pre compute a bunch of Think of them as vector neighborhoods, okay?
简单说,就是把相似度高的向量聚成一群,比如都属于同一种狗的向量。
And so it's basically a cluster, a bunch of vectors that are clustered together in similarity, a type of dog as an example.
这些向量邻域都是离线、异步提前算好的,这样你做查询的时候,完全不会影响响应速度。
These vector neighborhoods, if you will, they're computed ahead of time offline, they're computed ahead of time asynchronously so that when you're doing your query, it's not gonna impact your query performance.
每当有新的向量被写入S3,系统就会根据它的位置,把它加入一个或多个已有的向量邻域中。
And then every time a new vector is inserted to S3, the vector gets added to one or more of these vector neighborhoods based on where it's located.
当你在S3向量中执行查询时,系统只需要在小得多的范围内搜索最近的邻域。
And so when you are executing a query on S3 Vectors, there's a much smaller search that's done to find the nearest neighborhoods.
真正加载到高速内存里的,只有相关的向量和它们所属的邻域。
And it's just the vectors and the vector neighborhoods that are loaded from S3 into a fast memory.
我们就是在这里应用最近邻算法的,这样 Warm 查询的响应时间可以低到一百毫秒以内。
That's where we apply the nearest neighbor algorithm and it can result in like really good sub one hundred millisecond query times.
说到 S3 的规模,每个索引最多能支持二十亿个向量。
And so, if you think about the scale for S3, we'll give you up to 2,000,000,000 vectors per index.
想想 S3 向量存储桶的规模——最多能到两万亿个向量,再配上一百毫秒以内的查询响应速度,这彻底打开了你理解数据语义、查询数据的可能性。
You think about the scale of a S3 vector bucket, which is up to 20,000,000,000,000 vectors, and you think about that combined with a hundred milliseconds or less for warm query performance, that just opens up what you can do with creating a semantic understanding of your data and how you can query it.
听起来非常有趣,但也很有挑战性,因为你们从第一天起就得为大规模做准备。
It sounds very interesting and also challenging because you have to build this for scale from day one.
我想这大概就是待在 S3 的好处和麻烦吧——你每次上线的东西,都得为极端规模做好准备,但在这里,这不过是周一的日常。
Guess that's one of the, I guess, benefits and curses of working at S3 that everything that you launch, you need to prepare for what will be extreme data elsewhere, but here it's just Monday.
我们也有 S3 服务的租户。
We have S3 service tenants as well.
其中一个租户,也是我经常说的一句话,我们工程师也这么讲:规模是你的优势。
And one of the tenants, and one phrase that I use all the time and our engineers do too, is scale is to your advantage.
如果你是一名工程师,能时刻记住这一点——你做的任何东西,规模都必须成为你的优势,这会彻底改变你的设计思路。
So if you are an engineer and you think about that, and you think about one of your tenants for anything you build is that scale must be to your advantage, it just changes how you design.
这意味着你不能搞出那种越做大、性能越差或者某个指标越糟的东西。
It means that you can't actually build something where the bigger you get, the worse your performance gets or the worse some attribute gets.
必须从设计上就保证,越做大,性能反而越好。
It has to be constructed so that the bigger you get, the better your performance gets.
S3 越大,跑在它上面的工作负载就越分散、越独立。
The bigger S3 gets, the more decorrelated the workloads are that run on S3.
这正是规模对你有利的绝佳例子。
That is a great example of scale is to your advantage.
所以我们做向量功能时,就像做 S3 里所有东西一样,我们问自己:怎么才能让规模成为我们的优势?
And so when we built vectors, just like we build everything in S3, we ask ourself, how can we build this such that scale is to our advantage?
怎么才能让一百毫秒甚至更短,只是我们追求的性能起点?
How can we build this such that a hundred milliseconds or less is just the start of the performance that we're going after?
怎么才能确保存储的向量越多,S3 向量功能的表现就越出色?
And how can we make sure that the more Vectors we have in storage, the better the traits of S3 for Vector.
我有个关于 S3 局限性的问题。
I have a different question about the limitations of S3.
我看到说 S3 里单个对象最大能存 50 太字节。
I read that the largest object you can store in S3 is 50 terabytes.
那为什么会对单个对象的大小设个上限呢?
Why is there a limit on the largest object?
我的意思是,理论上可以用多块硬盘来存更大的文件,但你们为什么还是定了这个限制?
I mean, I can think we can imagine this will be through either multiple hard drives and so on, but why did you decide to have a limit?
我只是想了解,你们团队当时是怎么考虑的,为什么最终定下这个数值?
You know, I'm just interested in more in the thought process of how the team comes up with, okay, this will be the limit and this is why.
其实这个 50 太字节的限制,已经是当初上线时的十倍了。
I mean, I think, first of all, that limit of 50 terabytes is 10 times greater than what we launched with.
我们刚推出的时候上限是 5 太字节,现在提升到了 50 太字节。
We launched with five terabytes, and now we're 50 terabytes.
有时候我们跟客户说这个数字,他们还会问:我哪会存那么大的文件?
And sometimes we sit and tell customers that, and they go, what am I gonna store that's gonna be 50 terabytes?
我们就回他们:高清视频啊?
And we're like, high resolution video?
对吧?
Right?
所以呢,我觉得
And so, you know, if I think about
单个客户。
Lone customer.
对吧?
Right?
你想想这类问题,比如文件大小限制,我们通常会针对某些使用模式做优化。
And so, you think about this sort of thing, you know, like, if you think about, I don't know, size size limits, generally speaking, we we do try to optimize for certain patterns.
当我们把单个对象的大小提升十倍时,主要就是为了提升底层系统的性能和扩展性。
And when you raise the size of an object by 10 times like we did, we're just optimizing for the performance and scale of the underlying systems.
上周我们也是把批量操作的规模扩大了十倍。
It's like we increased the scale of our batch operations by 10 times last week too.
这么做的目的是,底层系统要适应现在人们普遍使用的新型工作模式。
And the idea behind that is that the underlying systems, we're just optimizing for distributions of work that are the new norm for how people are doing things.
我们会持续不断地调整。
And we'll just keep on changing.
说实话,我们的限制并不多,但我们会一直关注客户在各种工作负载中的使用情况,看看有没有需要改进的地方。
We don't have too many limits, to be honest, but we'll just keep on looking at what customers are doing across the distribution of workloads and seeing if there's something that needs to be changed.
对我们来说,最重要的是,我们和客户聊了很多,他们都说:真的吗?
The big thing for us, again, we did have a lot of conversations with customers and they're like, really?
我根本没有那么多那么大的独立对象。
Like, I don't have that many individual objects that are that big.
但随着摄像头、手机这些东西越来越多,我们看到更大的文件也越来越多,所以我们希望他们在S3里能毫无限制地增长。
But with the increase of, you know, cameras and phones and things like that, we are seeing more larger size objects and we just wanted them to be able to grow unfettered in S3.
那S3是怎么演进的?你们的路线图又发生了什么变化?
And so, how does S3 evolve and and how has the roadmap changed?
到目前为止,我理解的是,你刚才说的每一句话都在讲:客户在这么做、那么做,而你们整天跟数据打交道,自然能看到趋势、数据、文件形态,也经常和客户交流。
Because so far what I picked up is everything that you told me is saying, well, you know, our customers were doing this or that and you obviously hear, you live and breathe data, so you see the patterns, you see stats, you see the objects, you also talk with them.
是只有你们通过和客户沟通,了解他们的痛点、他们在用什么、用得越来越多的是什么,然后才决定去改进——比如调整限制,或者发现需要新增一种数据类型,因为客户已经在上面自己构建数据结构了?还是说,你们也有一个更宏观的愿景和路线图,会主动规划未来要做什么?
Is it only you talking with customers seeing what's happening, what they're struggling with, what they're using more of, and then deciding to improve that, may that be the limits, may that be figuring out we need a new data type because they're now building their own data types on top of it, Or is there also some kind of more, kind of, alright, here's a vision, here's a roadmap of what we'll do?
这是个很好的问题。
It's a great question.
事实上,我们经常讨论的一个话题就是 S3 的一致性,对吧?
And in fact, one of the things that we talk about all the time is the coherency of S3, right?
所以,人们对 S3 有一些一直期待的特性。
And so there are certain things that people always expect from S3.
这些就是 S3 的核心特质。
It's the traits of S3.
比如我们之前提到的持久性和可用性这些方面。
It's the durability availability attributes that we talked about.
为了保证这些,背后其实投入了大量的工程工作,明白吗?
And so a fair amount of engineering goes on under the hood for that, okay?
这些能力中,有些我们今天可能提到了,也可能没来得及细说。
And it's a set of capabilities that, you know, we may or may not have talked about today.
说起来,如果回想一下 2020 年,我觉得自那以后 S3 已经推出了上千项新功能。
In fact, if you think about, I think back to 2020, I think we've launched over a thousand new capabilities since 2020 in S3.
其中一些是我们认为占路线图90%的内容,也就是客户明确提出来的需求,明白吗?
And some of them are what we think of as the 90% of the roadmap, which is what people ask for explicitly, okay?
比如,我们的某些媒体客户希望支持更大的对象尺寸,我们就实现了这个功能。
And so for example, some of our media customers want the bigger object size, and so we delivered that.
还有不少客户大量使用批量操作功能。
We have other customers that do a lot with batch operations.
但我们也有一些功能是自己发明的,因为我们观察客户如何使用数据,然后问自己:我们怎么才能帮他们做到这一点?
But then we have some things that we invent because we look at what customers are doing with the data and we ask ourselves, how can we build that?
向量功能就属于这一类。
Vector kind of falls into that category.
关于向量,当我们审视S3的发展方向时,我们告诉自己:我们完全可以继续让S3成为全球最优秀的数据存储库。
For Vector, when we looked at S3 and how S3 is evolving, we told ourselves like, look, we can continue to make S3 the best repository for data on the planet.
我们一定会做到,一定会。
And we will, we will.
每天都有工程师在为此努力工作。
We have engineers that come in every day working to make that so.
但还有一个关键问题,就是你怎么确保手里的数据真的能用?
But there's this other element of how do you make sure that the data that you have is in fact usable?
怎么确保它能以行业标准的方式使用,比如在我们的表格数据上加一层Iceberg?
And how do you make sure that it's usable in a way that's, you know, industry standard, like that Iceberg layer on top of our tabular data?
但真正能用,是因为现在的AI模型在嵌入技术上太强大了,只要你能把数十亿个向量存下来,AI就能帮你全面理解数据,让你以全新的方式使用它。
But it's usable because AI models have now gotten so good at embeddings that you can have AI give you a symmetric understanding of your data if only you had the cost point of putting billions of vectors into storage so you could actually understand and use your data in a different way.
对我们来说,很多工作其实是退一步看,不只关注客户明确提的需求,更要打破数据使用的成本限制——这正是S3在做的事。
And so for us, a lot of it is kinda taking a step back and looking not just at what customers ask us for, but we want to remove the constraint of a cost of data, which is what we do in S3.
我们还要打破操作数据的限制——S3同样也在解决这个问题。
And we want to remove the constraint of working with your data, which is what we do in S3 too.
如果我们能同时做到这两点,让数据随着业务需求自由扩展,让你能充分释放AI带来的新能力,顺应数据世界的变革,那我们就有了一个清晰的形态。
And when we can do both of those things, if we can make it possible that your data grows as your business needs it, and you can tap into all the capabilities that you're getting with AI and how the world is changing for data, then we have a shape.
我们管这叫产品形态。
We call it a product shape.
然后,我们就有了一个产品形态。
Then we have a product shape.
产品形态。
Product shape.
什么叫产品形态?
What's a product shape?
这有点像一种不断演化的趋势。说到S3,我觉得它就像一个有生命、会呼吸的系统,产品形态在持续变化,但始终围绕着你对S3核心特性的期待,同时又让你能灵活地调整数据的使用方式。
It's sort of like an emerging When I think about S3, I think of it as almost like this living, breathing organism where the shape of the product is evolving, but it's evolving with coherency around what you expect for the traits of S3, but it's evolving in a way that lets you steer into how you wanna use data.
不只是现在怎么用数据,还包括未来打算怎么用。
And how do you wanna use data not just now, but in the future.
我们会根据你对数据的使用需求,持续优化S3的产品形态。
And we will continue to evolve the product shape of S3 based on what you wanna do with data.
在很多方面,我们已经突破了传统对象存储或数据库的界限。
And so in a lot of ways, we're sort of transcending the boundaries of what object storage was, or what a database traditionally was.
现在我们有了表格格式,支持条件查询,正在朝一种全新的形态发展。
Because now we have tabular formats, we have conditionals, and we're evolving into this new shape.
而这一切,最终都独一无二地属于S3。
And it is ultimately uniquely S3.
听起来你这些微服务就像在不断生长,有点像植物或者活物,对吧?
It of sounds like you have all these microservices, it's kind of evolving, almost like a plant or a living organism, no?
没错。
Yes.
我以前确实当过和平队的志愿者,搞林业的。
I am, in fact, a former Peace Corps volunteer from forestry.
所以我常从自然界找比喻来理解事情。
And so, you know, a lot of times I will go back to the natural world for my metaphors.
S3就像是一个有生命的数据仓库,让人能用数据做出以前根本不敢想的事。
And, I mean, S3 is this living, breathing repository of data that lets people do things with data that they never thought possible.
这挺有意思的,因为工程师通常不会把我们搭建的系统跟活的生命体联系起来。
It's just interesting, because I think as engineers, don't often think to relate the systems that we build with a living organisation.
其实系统里有代码,但像你说的,还有人、服务器,还有按固定节奏发生的故障。
When in fact, obviously there's code, but as you said, there's people, there's servers, there's failures that now happen a cadence.
你几乎能预测今天有多少硬盘会出问题,尤其是在你们这种规模下——这会不会是因为系统大到一定程度,自然就出现了这种特性?我跟你聊觉得特别有意思的是,S3内部的工程方式,跟小公司、初创团队完全不一样,那些团队可能处理几TB,最多几PB数据,也就到头了。
You can almost just you you can probably predict how many hard drives are failing today, in fact, at at your scale already, which, again, maybe it's do you think it's because of the scale when things become large enough, they start to have these characteristics because what I find fascinating talking to you is the way engineering works inside of S3 feels very different to how it works inside a smaller organization, your kind of startup, which again does, you know, like terabytes of data or maybe even a few petabytes, but but that's kind of it.
你见过一些这样的团队。
And you've seen some of these organizations.
在这么大的规模下,到底哪些东西会变?
What what changes at at at this large scale?
你觉得是什么让你们和 S3 团队的工作环境显得这么不一样?
What what do you think that makes it it feels pretty different, the the world that you and and the S3 teams work in.
确实如此。
It does.
但为了维持 S3 的特性并让它持续演进,我们得不断回归简化。
But, you know, in order for us to sustain the traits of S3 and to evolve it over time, we have to constantly go back to simplification.
我们的系统确实很复杂,有这么多微服务,但我始终认为,每个微服务都得把一两件事做到极致。
We have a very complex system with all of our different microservices, but I kinda go back to those microservices have to do one or two things really well.
我们必须坚持这一点。
And we have to stay true to that.
否则,分布式系统一旦变得过于复杂,迟早会变得无法维护。
Otherwise, you know, the complexification of a distributed system, you know, it's unmaintainable over time.
对于S3来说,这个理念就是——S3的核心是简单。
And for S3, this concept of, okay, there's a simple in S3.
而S3的简单体现在几个方面。
And the simple in S3 is a couple of things.
首先,是用户模型的简洁:不仅API设计得简单,还能直接用SQL查询S3里的数据,或者接入AI嵌入模型,让数据的语义理解变得特别轻松,根本不用费劲去标注一堆元数据。
One, it's a simplicity of the user model, where not only do you have a simple API, but now you have the simplicity of using SQL with S3 or you have the simplicity of being able to leverage these AI embedding models, which makes semantic understanding of your data so much easier than having to annotate, you know, a whole metadata layer.
所以,这种简洁性已经融入了S3的用户模型。
And so that concept of simplicity is in the user model of S3.
但在底层,如果你参加我们的工程会议,就会听到工程师们一直在讨论:怎么用最简洁的方式实现这个功能。
But under the hood, if you sit on any of our engineering meetings, you will hear our engineers talk about how do we make sure that we implement this capability with the greatest simplicity that we possibly can.
说到这个,你们通常会招什么样的工程师来负责S3?更看重哪些特质或者过往经验?
Speaking of which, what type of engineers do you typically hire to to work at S3 in terms of what kind of traits, potentially past experience do you look for?
我们招各种背景的工程师。
Well, we hire all kinds of engineers.
S3团队里有很多刚入行的年轻工程师。
You know, we have a lot of engineers on S3 who are early career.
他们刚毕业,要么是本科生,要么是研究生。
They're straight out of school or they're at a undergrad or graduate school.
就像我说的,我们团队里有大量工程师在S3待了很长时间,也有刚加入的,各种情况都有。
And like I said, we have like a ton of engineers who have been on S3 for a long time and everything in between.
我们做数据的团队里,有一种很强的主人翁意识。
I think there's a really strong element in our teams that work on data around ownership.
每个人都有一种发自内心的使命感。
People feel this like personal sense of commitment.
我确实有这种感觉。
I feel it.
我每天上班都能感受到,我对自己负责的部分有强烈的责任感——确保它稳定、好用,让你能专心思考应用下一步该做什么,而不是纠结于该用什么存储、怎么扩展。
I feel it every day I come in, where I feel a personal sense of commitment to your bite, to the preservation of your bite, to the usefulness of your bite, to the ability for you to think about what your application does next and not the types of storage that you need or how you grow it.
这种深刻的主人翁意识和使命感,在我们的数据团队里非常普遍。
And that deep sense of ownership and that deep sense of commitment is a very, very common thread across our data teams.
因为我们清楚,归根结底,每个现代企业都是数据驱动的企业,无论人们想用传统系统还是AI,核心都是你的数据在塑造应用体验。
Because we know that at the end of the day, every modern business is a data business and everything that people are trying to do with traditional systems, AI, whatever, is based on your data as shaping the core of your application experience.
所以这些数据就是我们的责任,我们对此有着深切的使命感。
And so that data is our responsibility and we feel it very deeply.
那对于一位有几年工作经验、在不同公司待过的中级软件工程师来说,你有什么建议?如果听完这些后,他深受鼓舞,想有一天加入像S3这样扎实的基础设施团队,或者对更有经验的人而言,你会建议他们关注哪些经历或活动,来判断这样的人才是否合适?
And what would your advice be to, let's say, mid career software engineer, someone who has a few years experience working at different places, who would who is actually, after listening to this, gets really enthusiastic and decides like, one day I'd love to work on a deep, strong infrastructure team like S3, or like, let's say, like more experienced folks, what are experiences, activities that you might look for that might help you consider these folks more?
持续的好奇心非常重要。
There's a strong value in relentless curiosity, okay?
我之前提到过‘循规蹈矩’,但当你在S3或者一个大规模分布式系统上工作时,这个系统本身就在不断重新定义存储的意义,你根本不是在框框里画画。
And, you know, I talked a little bit about coloring within the lines, and how when you work on S3 or a large scale distributed system, which continues to reinvent what storage means, you're not really coloring within the lines.
你得退后一步,重新思考:今天我来画这些边界,但我也清楚,未来很可能要擦掉它们,重新划定新的界限,去适应技术的发展方向。
You're just kinda looking, you're taking a step back and you're saying, you know, I will draw what the lines are today and I will know that I might have to rub those out and draw new lines in the future for wherever things go.
我有三个孩子,都在上大学。
And so, you know, I have three kids who are in university.
我有两个孩子在读大学,还有一个在读研究生。
I have two kids in university and one in grad school.
我觉得特别重要的一点是,永远要抽身出来,去看看最新的研究进展。
And that is one thing that I, you know, I think is really important, is to always take a step back, take a look at the latest research.
我待会儿跟你们分享的一些论文,讲的是我们如何把形式化方法应用到存储系统中。
And some of the papers that I'll share with you are around how we, you know, we either took formal methods and we brought them into storage systems, right?
或者我们换了一种思路来看待故障,这种创造力、这种永不满足的好奇心,再加上工程上的巧思,绝对错不了。
Or we thought about failure in a different way where that creativity, that relentless curiosity and that creativity with engineering, I don't think you can go wrong with that.
我认为,无论下一代软件是在S3上开发,还是在别的地方,归根结底都靠工程师的创造力驱动。
I think the next generation of software, matter if it's built in S3 or elsewhere, it is all driven by the creativity of the engineering mind.
这种能力,其实我们每个人都有。
And it is in all of us.
我们只需要把它激发出来,释放出来,就能打造出像S3这样了不起的东西。
We just have to kinda unlock it and unleash it and we will brand we'll build amazing things like S3.
我也特别喜欢S3这一点——它不仅创造出了以前根本不存在的东西,甚至以前根本没人敢想象,现在我听到不少初创公司都在S3的基础上做创新。
And I also love that with S3, not only has S3 created something that did not exist, I think it just was unimaginable because it didn't exist, but now I'm hearing startups that are building on top of S3.
比如Turbo Puffer,就是个很好的例子。
Think Turbo Puffer is a good example.
他们之所以能不断创新,是因为有了一个稳固的底层基础,我觉得创新其实分不同的层次。
You know, they're building innovation because now they have a base layer, and I I feel there's different levels of innovation.
你可以选择在最底层、再高一层,或者更高层去创新,关键是用对了基础工具,对吧?
You decide where you wanna innovate at the very lowest level, one level higher, and so on, and you just use the right primitives, right?
对你来说,就是把硬件和存储做得比谁都好。
In your case, this is just doing hardware and storage better than anyone.
而在其他层面,就是比别人更擅长运用合适的基础工具。
In the other layers, it will be using the right primitives better than anyone.
看到现在有这么多不同类型的基础设施基于 S3 构建起来,确实让我们非常兴奋。
Yeah, it's very exciting for us to see so many different types of infrastructure built on S3 now.
最后,你有没有哪本书或哪篇论文特别推荐?你读过之后觉得特别棒,为什么?
And as closing, what is a book or a paper that you would recommend a reading that you enjoyed and why?
我读过很多不同领域的论文。
I read a lot of different papers.
我现在特别着迷于嵌入模型发展得这么快。
I am fascinated by how quickly the evolution of embedding models are coming along now.
尤其是我特别感兴趣的一个领域,是多模态嵌入模型。
And in particular, a field of science that I'm quite interested in is the multimodal embedding model.
因为你知道,我们所体验的世界是多模态的,所以对数据的理解也应该是多模态的。
Because as you know, the world that we experience is multimodal, and therefore the understanding that we have of data should be multimodal as well.
因此,围绕多模态嵌入模型的一个全新研究领域正在迅速兴起。
And so there's this whole field of science that's emerging quite rapidly around multimodal embedding models.
所以我建议从事数据相关工作的人多关注这一点,因为我觉得这将是下一代数据的核心。
And so that is something that I encourage people who are working in the field of data to look at, because I think that is the next generation of data.
如果你想想未来的数据湖,我觉得真正关键的其实是元数据。
If you think about, you know, the next world of data lakes, I think it's actually gonna be on metadata.
是数据的语义理解,而不是数据本身。
It's gonna be on the semantic understanding of our data.
理解这些语义如何通过向量生成,以及如何在多种模态间进行搜索和处理,这既是研究的重点,也是技术突破的关键。
And understanding how that is created through vectors and how it's being searched and done across multiple modalities, think is an important area of both research and advancement.
所以这就是我建议大家在数据领域重点关注的方向。
And so that's what I would encourage people to look at in the world of data.
我觉得向量技术会大有作为,尤其是我们为S3向量存储设定的这个价格水平,更是会加速它的普及。
I think Vectors is gonna be quite big, particularly at the price point that we've introduced for S3 storage for Vectors.
我对这个特别期待。
And I'm excited about it.
我觉得我们对数据的理解才刚刚开始,真想看看接下来会发生什么。
I think, you know, I think we're just getting started with data and an understanding of our data, and I can't wait to see what comes next.
太棒了。
Amazing.
你有什么书可以推荐吗?
And and do you have any book recommendations?
我来给你推荐一本书,万一你的读者感兴趣呢。
I will give you a book recommendation just in case your readers are interested.
这本书不是关于计算机科学的。
It won't be in the field of computer science.
它讲的是我们周围生态系统的演变,以及如何保护本地的蜜蜂和昆虫。
It will be about the evolution of the ecology around us and supporting the bees, the native bees and insects around us.
虽然稍微有点偏题,但我还是推荐一本,如果你的读者想了解如何保护地球上的蜜蜂,不妨看看。
So a tiny bit farther afield, but I'll give you a book recommendation, and if your your readers are interested, they can they can take a look at how to support the bees of the planet.
谢谢您,Mai-Lan。
Well, Mai-Lan, thank you very much.
这次对话太精彩了,能深入了解数据世界的庞大规模,以及如何妥善处理、保障数据的持久性,真是令人着迷。
This was fascinating and and very interesting to get a peek into this massive world of scale of data and respecting the bite and treating it and making sure that it's durable.
和您聊天非常愉快,也感谢您本人,我知道您是S3的粉丝,更要感谢所有使用S3的听众——我们今天能做这些事,完全离不开大家的反馈和鼓励。
It was great talking to you, and thank you to both yourself, I know you're a fan of S3, and to all of your listeners who use S3, we quite literally wouldn't be able to do what we do without the feedback and the encouragement from everybody who uses S3 today.
真的很感谢你们。
So thank you for that.
太惊人了。
Just wow.
我早就猜到S3这样的系统背后一定很复杂,但没想到规模竟如此惊人。
I always suspected there's a lot of complexity behind a system like S3, but I just did not realize the scale of it.
以前我做系统时,哪怕只有几百台虚拟机,单台机器出故障都是罕见的事,根本不会当成常态来应对。
Whenever I worked on systems with even hundreds of virtual machines, failure of one machine was a rare event and not something that we counted on.
和Mai-Lan聊的时候,她轻描淡写地说,我们对话期间就有好几台机器宕机了——而S3早就预料到这种情况,把它当成日常事务来处理。
During my conversation with Mai-Lan she casually mentioned that several machines have failed during our conversation, which is something that the S3 knows and prepares for, and treats it like an everyday event.
我特别欣赏AWS在S3团队里同时坚持的两个看似矛盾的原则:尊重历史,同时技术上无所畏惧。
I personally really liked how AWS has two conflicting tenants heavily used on the S3 team, respect what came before and technically fearless.
对于这样一个庞大的系统,很容易因为太多公司依赖它就选择保守行事,但如果真这么做了,S3迟早会被甩在后面。
For such a massive system it will be easy to say let's move conservatively because of how many companies depend on us but if they did so S3 would fall behind.
最让我惊叹的是,AWS居然实现了强一致性,还向所有客户全面上线,既没涨价,也没增加延迟。
Finally, I'm still in awe that AWS put strong consistency in place, rolled it out to all customers, and did not increase pricing nor did they increase latency.
在S3这样的规模下,这绝对是顶尖级别的工程成就。
At S3 scale, this is an absolutely next level engineering achievement.
事实上,这可能是过去十年里最不为人知的工程壮举之一。
In fact, it was probably one of the lesser known engineering feats of the decade.
希望你觉得这期节目和我一样精彩。
I hope you found the episode as fascinating as I did.
如果你想更深入了解亚马逊和AWS,可以在节目简介里查看我与AWS故障应对团队做的独家深度访谈,讲他们如何处理服务中断。
If you'd like to learn more about Amazon and AWS, check out the exclusive deep dive I did with AWS' incident management team on how they handle outages in the show notes below.
在《务实工程师》里,我还做过其他关于亚马逊和AWS的深度分析。
In The Pragmatic Engineer, I also did other deep dives about Amazon and AWS.
这些链接也放在节目笔记里了。
They are also linked in the show notes.
如果你喜欢这个播客,别忘了在你常用的播客平台和YouTube上订阅。
If you enjoy this podcast, please do subscribe on your favorite podcast platform and on YouTube.
如果你还给节目打分,那就太感谢了。
A special thank you if you also leave a rating on the show.
谢谢收听,我们下期再见。
Thanks, and see you in the next one.
关于 Bayt 播客
Bayt 提供中文+原文双语音频和字幕,帮助你打破语言障碍,轻松听懂全球优质播客。