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

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

by Ian Gorton
May 2024
Intermediate
278 pages
5h 24m
Chinese
China Machine Press
Content preview from 构建可扩展分布式系统:方法与实践
异步消息传递
|
119
所有消息复制(或镜像)给追随者,并删除已成功传递的消息。如图
7-4
所示,其中包
含了
复制
删除
操作。此方案的具体行为及其对代理性能的影响取决于产品的需求和具
体实现。
使用领导者
-
追随者消息复制方式,追随者被称为热备用,是领导者的副本,如果领导
者发生故障,则追随者顶上。在故障场景下,生产者和消费者可以通过切换访问追随者
来继续操作,我们也称之为
故障转移
。故障转移在消息代理的客户端库中实现,因此对
生产者和消费者来说是透明的。
实现一个可以执行队列复制的代理是一件复杂的事情。在复制消息时,代理需要处理许
多细节的故障情况。我将在第
10
章和第
11
章讨论可扩展数据管理时开始提出这些问题
并介绍相应的解决方案。
一些建议:不要考虑
使用自己的
复制方案或任何其他复杂的分布式算法。软
件世界充斥着构建特定于应用程序的分布式系统基础架构的失败尝试,只是
因为可用的解决方案“不能完全满足我们的需求”或“成本太高”。相信我,
你的解决方案将不如现有解决方案有效,开发成本将超出你的预期。你最终
可能会扔掉你的代码。这些算法很难被大规模正确实现。
7.2
示例:
RabbitMQ
RabbitMQ
是分布式系统中使用最广泛的消息代理之一。你将在所有应用领域(从金融
到电信再到建筑环境控制系统)的系统部署中遇到它。它于
2009
年左右首次发布,并已
发展成一个功能齐全的开源分布式消息代理平台,支持大多数主流语言构建的客户端。
RabbitMQ
代理采用
Erlang
语言构建,主要为
AMQP
Advanced Message ...
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