Skip to Content
构建可扩展分布式系统:方法与实践
book

构建可扩展分布式系统:方法与实践

by Ian Gorton
May 2024
Intermediate
278 pages
5h 24m
Chinese
China Machine Press
Content preview from 构建可扩展分布式系统:方法与实践
16
|
1
贯穿本书,我将重新审视这两个设计原则,即复制和优化。由于我们正在构建的是分布
式系统,你将看到采用这两个设计原则会产生许多复杂的影响。分布式系统具有很多特
性,使得构建可扩展系统变得
有意思
,在这里,“有意思”既有积极的含义,也有消极
的含义。
1.5
可扩展性与成本
让我们举一个简单的假设例子来观察可扩展性和成本之间的关系。假设我们有一个基于
Web
的系统(例如
Web
服务器和数据库),它可以处理
100
个并发请求,平均响应时间
1 s
。我们有一个业务需求要求扩展这个系统,即在相同的响应时间下处理
1000
个并
发请求。在不做任何改动的情况下,对系统进行简单的负载测试,性能如图
1-2
(左)所
示。随着请求量的增加,我们看到平均响应时间稳步增长,在预期请求量下增长到
10 s
显然,这个部署配置不能满足我们当前的要求,系统无法扩展。
10 10
11
100 1001000 1000
每秒请求量
每秒请求量
平均响应时间
平均响应时间
1-2:扩展应用程序;左侧表示不可扩展的性能,右侧表示可扩展的性能
为达到所需的性能,需要在工程方面做一些努力。图
1-2
(右)显示了修改后的系统性
能。它现在能在特定的响应时间内处理
1000
个并发请求。因此,我们成功地扩展了系
统。放松时间到了!
然而,一个重要问题迫在眉睫。需要多少努力和资源才能实现这一性能?也许只是在更
强大的(虚拟)机器上运行
Web
服务器。在云上执行这类操作,即重新配置系统最多需
30 min
。稍微复杂一点的是重新配置系统来运行多个
We
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

What Successful Brick-and-Mortar Retailers Get Right

What Successful Brick-and-Mortar Retailers Get Right

Rob Angell
What Successful Project Managers Do

What Successful Project Managers Do

W. Scott Cameron, Jeffrey S. Russell, Edward J. Hoffman, Alexander Laufer
Three Essentials for Agentic AI Security

Three Essentials for Agentic AI Security

Paolo Dal Cin, Daniel Kendzior, Yusof Seedat, Renato Marinho

Publisher Resources

ISBN: 9787111750697