Skip to Content
Kafka权威指南(第2版)
book

Kafka权威指南(第2版)

by Gwen Shapira, Todd Palino, Rajini Sivaram, Krit Petty
November 2022
Beginner to intermediate
346 pages
11h
Chinese
Posts & Telecom Press
Content preview from Kafka权威指南(第2版)
跨集群数据镜像
175
央数据中心。镜像进程会读取每一个区域数据中心的数据,并将它们重新生成到中心集
群。如果多个数据中心出现了重名的主题,则可以将这些数据写到中心集群的一个同名主
题上,或者写到多个单独的主题上。
10.2.3
 双活架构
当有两个或多个数据中心需要共享部分或全部数据,并且每个数据中心都可以生成和读取
数据时,可以使用双活架构,如图
10-3
所示。
所有应
用程序
所有应
用程序
西海岸用户 中南部用户
旧金山
Kafka
集群
休斯敦
Kafka
集群
10-3:双活架构模型
这种架构的主要好处在于,它可以为就近用户提供速度更快的服务,具有性能方面的优
势,而且不会因为数据可用性问题(在星型架构中就有这种问题)做出功能方面的牺牲。
还有一个好处是冗余和弹性。因为每个数据中心都具备完整的功能,所以一旦一个数据中
心发生故障,则可以把用户重定向到另一个数据中心。这种故障转移只涉及网络重定向,
是一种最简单也最透明的故障转移方案。
这种架构的主要问题在于,如何在多个数据中心进行异步读写时避免冲突。比如,在镜像
数据时如何确保同一条消息不会被无止境地来回镜像?更重要的是,保证跨数据中心的数
据一致性会变得更加困难。以下是可能遇到的问题。
如果用户向一个数据中心发送数据,并从另一个数据中心读取数据,那么在用户读取数
据之前,他发送的数据有可能还没有被镜像到那个数据中心。对用户来说,这就好比把
一本书加到购物车里,但是当他点开购物车时,书不在里面。因此,在使用这种架构时,
开发人员经常会将用户“黏”在同一个数据中心里,确保用户在大多数情况下使用的是 ...
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

时间序列分析实战:基于机器学习和统计学

时间序列分析实战:基于机器学习和统计学

Aileen Nielsen
Spark机器学习实战

Spark机器学习实战

Posts & Telecom Press, Siamak Amirghodsi, Meenakshi Rajendran, Broderick Hall, Shuen Mei
写给系统管理员的Python脚本编程指南

写给系统管理员的Python脚本编程指南

Posts & Telecom Press, Ganesh Sanjiv Naik
Kubernetes编程

Kubernetes编程

Michael Hausenblas, Stefan Schimanski

Publisher Resources

ISBN: 9787115601421