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权威指南
初识
Kafka
5
1.2.3
 主题和分区
Kafka
的消息通过
主题
进行分类。主题就好比数据库的表,或者文件系统里的文件夹。主
题可以被分为若干个
分区
,一个分区就是一个提交日志。消息以追加的方式写入分区,然
后以先入先出的顺序读取。要注意,由于一个主题一般包含几个分区,因此无法在整个主
题范围内保证消息的顺序,但可以保证消息在单个分区内的顺序。图
1-5
所示的主题有
4
个分区,消息被追加写入每个分区的尾部。
Kafka
通过分区来实现数据冗余和伸缩性。分
区可以分布在不同的服务器上,也就是说,一个主题可以横跨多个服务器,以此来提供比
单个服务器更强大的性能。
主题“topicName”
分区0
分区1
分区2
分区3
消息写入
1-5:包含多个分区的主题表示
我们通常会使用
这个词来描述
Kafka
这类系统的数据。很多时候,人们把一个主题的数
据看成一个流,不管它有多少个分区。流是一组从生产者移动到消费者的数据。当我们讨
论流式处理时,一般都是这样描述消息的。
Kafka Streams
Apache Samza
Storm
这些框
架以实时的方式处理消息,也就是所谓的流式处理。我们可以将流式处理与离线处理进行
比较,比如
Hadoop
就是被设计用于在稍后某个时刻处理大量的数据。第
11
章将会介绍流
式处理。
1.2.4
 生产者和消费者
Kafka
的客户端就是
Kafka
系统的用户,它们被分为两种基本类型:生产者和消费者。除
此之外,还有其他高级客户端
API
——用于数据集成的
Kafka Connect API
和用于流式处理
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