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版)
精确一次性语义
143
录和偏移量,还有另外一个难点:
Kafka
read_committed
隔离级别太弱了,根本无法保
留数据库的事务。消费者不仅看不到未提交的消息,也不保证可以看到事务中已提交的所
有消息,因为消息在某些主题上可能会滞后,而消费者没有事务的边界信息,所以它不知
道事务何时开始和结束,也不知道看到的是部分消息还是全部消息。
4.
将数据从一个集群复制到另一个集群
这个场景有点儿微妙:将数据从一个
Kafka
集群复
制到另一个集群是有可能支持精确
一次性保证的。一个为
MirrorMaker 2.0
加精确一次性语义的改进提议(“
KIP-656:
MirrorMaker2 Exactly-once Semantics
)对此进行了描述。在撰写本章时,这个提议仍处于
草稿阶段,但算法已经描述得很清楚了,就是保证源集群中的每条记录都将被精确地复制
到目标集群一次。
但这并不能保证事务是原子的。如果一个应用程序以事务的方式生成了几条记录和偏移
量,然后
MirrorMaker 2.0
将它们复制到了另一个
Kafka
集群
,那么在复制过程中事务属性
就有可能会丢失。造成事务属性丢失的原因与将数据从
Kafka
复制到关系数据库一样
:从
Kafka
读取数据的消费者并不知道或者能够保证已经读取了事务的所有记录
。如果它只订
阅了部分主题,那么就会只复制事务的一部分记录。
5.
发布和订阅模式
这里有一个更为微妙的例子。前面讨论的精确一次性保证是“消费
处理
生产”的模
式,而发布和订阅也是一个非常常见的模式。事务为发布和订阅模式提供了一些保证 ...
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