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权威指南
88
6
ACID
指的是
原子性
一致性
隔离性
持久性
。如果一个供应商说他们的数据库遵循
ACID
规范,其实就是在说他们的数据库支持与事务相关的行为。
有了这些保证,我们才能相信关系型数据库的事务特性可以确保应用程序的安全。我们知
道系统承诺可以做到些什么,也知道在不同条件下它们会发生怎样的行为。我们了解这些
保证机制,并基于这些保证机制开发安全的应用程序。
所以,了解系统的保证机制对于构建可靠的应用程序来说至关重要,这也是能够在不同条
件下解释系统行为的前提。那么
Kafka
可以在哪些方面作出保证呢?
Kafka
可以保证分区消息的顺序。如果使用同一个生产者往同一个分区写入消息,而且
消息
B
在消息
A
之后写入,那么
Kafka
可以保证消息
B
的偏移量比消息
A
的偏移量大,
而且消费者会先读取消息
A
再读取消息
B
只有当消息被写入分区的所有同步副本时(但不一定要写入磁盘),它才被认为是“已
提交”的。生产者可以选择接收不同类型的确认,比如在消息被完全提交时的确认,或
者在消息被写入首领副本时的确认,或者在消息被发送到网络时的确认。
只要还有一个副本是活跃的,那么已经提交的消息就不会丢失。
消费者只能读取已经提交的消息。
这些基本的保证机制可以用来构建可靠的系统,但仅仅依赖它们是无法保证系统完全可靠
的。构建一个可靠的系统需要作出一些权衡,
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