Skip to Content
Kafka权威指南
book

Kafka权威指南

by Neha Narkhede, Gwen Shapira, Todd Palino
January 2018
Beginner to intermediate
234 pages
7h 8m
Chinese
Posts & Telecom Press
Content preview from Kafka权威指南
跨集群数据镜像
121
这种架构有一个简单的变种,如果只有一个本地集群,那么整个架构里就只剩下两个集
群:一个首领和一个跟随者,如图
8-2
所示。
关键
应用
关键的生产
环境Kafka集群
非关键的
报表Kafka集群
报表
8-2:一个首领对应一个跟随者
当消费者需要访问的数据集分散在多个数据中心时,可以使用这种架构。如果每个数据中
心的应用程序只处理自己所在数据中心的数据,那么也可以使用这种架构,只不过它们无
法访问到全局的数据集。
这种架构的好处在于,数据只会在本地的数据中心生成,而且每个数据中心的数据只会被
镜像到中央数据中心一次。只处理单个数据中心数据的应用程序可以被部署在本地数据中
心里,而需要处理多个数据中心数据的应用程序则需要被部署在中央数据中心里。因为数
据复制是单向的,而且消费者总是从同一个集群读取数据,所以这种架构易于部署、配置
和监控。
不过这种架构的简单性也导致了一些不足。一个数据中心的应用程序无法访问另一个数据
中心的数据。为了更好地理解这种局限性,我们举一个例子来说明。
假设有一家银行,它在不同的城市有多家分行。每个城市的
Kafka
集群上保存了用户的信
息和账号历史数据。我们把各个城市的数据复制到一个中心集群上,这样银行就可以利用
这些数据进行业务分析。在用户访问银行网站或去他们所属的分行办理业务时,他们的请
求被路由到本地集群上,同时从本地集群读取数据。假设一个用户去另一个城市的分行办
理业务,因为他的信息不在这个城市,所以这个分行需要与远程的集群发生交互(不建议
这么做),否则根本没有办法访问到这个用户的信息(很尴尬) ...
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

精通機器學習

精通機器學習

Aurélien Géron
精通特征工程

精通特征工程

Alice Zheng, Amanda Casari
高效能PYTHON程式設計

高效能PYTHON程式設計

Micha Gorelick, Ian Ozsvald

Publisher Resources

ISBN: 9787115473271