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权威指南
186
11
如果事件流的定义里没有提到事件所包含的数据和每秒钟的事件数量,那么它就变得毫无
意义。不同系统之间的数据是不一样的,事件可以很小(有时候只有几个字节),也可以
很大(包含很多消息头的
XML
消息),它们可以是完全非结构化的键值对,可以是半结构
化的
JSON
,也可以是结构化的
Avro
Protobuf
。虽然数据流经常被视为“大数据”,并
且包含了每秒钟数百万的事件,不过这里所讨论的技术同样适用(通常是更加适用)于小
一点的事件流,可能每秒钟甚至每分钟只有几个事件。
知道什么是事件流以后,是时候了解“流式处理”的真正含义了。流式处理是指实时地处
理一个或多个事件流。流式处理是一种编程范式,就像请求与响应范式和批处理范式那
样。下面将对这
3
种范式进行比较,以便更好地理解如何在软件架构中应用流式处理。
请求与响应
这是延迟最小的一种范式,响应时间处于亚毫秒到毫秒之间,而且响应时间一般非常稳
定。这种处理模式一般是阻塞的,应用程序向处理系统发出请求,然后等待响应。在数
据库领域,这种范式就是
线上交易处理
OLTP
)。销售点(
POS
)系统、信用卡处理系
统和基于时间的追踪系统一般都使用这种范式。
批处理
这种范式具有高延迟和高吞吐量的特点。处理系统按照设定的时间启动处理进程,比如
每天的下午两点开始启动,每小时启动一次等。它读取所有的输入数据(从上一次执行
之后的所有可用数据,或者从月初开始的所有数据等),输出结果,然后等待下一次启
动。处理时间从几分钟到几小时不等,并且用户从结果里读到的都是旧数据。在数据库 ...
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