Skip to Content
微服务与事件驱动架构
book

微服务与事件驱动架构

by Adam Bellemare
October 2021
Beginner to intermediate
250 pages
7h 11m
Chinese
Posts & Telecom Press
Content preview from 微服务与事件驱动架构
2
1
1.1
 什么是事件驱动型微服务
微服务和微服务类型的架构已经存在很多年了,它们有许多不同的形式和名字。面向服务
的架构(
service-oriented
architecture
SOA
)通常由多个相互直接同步通信的微服务构成。
消息传递架构使用可被消费的事件在微服务之间进行异步通信。基于事件的通信当然不算
新颖,但大规模并实时地处理大数据集是新的需求,而这要求对旧的架构类型进行改进。
在现代的事件驱动型微服务架构中,系统通过发布和消费事件来通信。这些事件并不会像
消息传递系统中那样在某次消费的时候就被销毁,而是可被其他多个消费者按需消费。这
是一个重要的区别,因为正是这个特性使得本书所要介绍的真正强大的模式成为可能。
微服务本身是微小且定制的,旨在帮助组织实现必要的业务目标。“微小”的一种典型定
义是能够在两周内实现,另一种定义是服务应该(在概念上)像是出自一个人的头脑。这
些服务从输入事件流中消费事件,运行它们特定的业务逻辑,并且可能发布自己的输出事
件,提供用于“请求
应”访问的数据,与某个第三方
API
通信或者执行其他必需的
操作。正如本书将要详细介绍的,这些服务可以是有状态的,也可以是无状态的;可以复
杂,也可以简单;可以被实现为长期运行的独立应用程序,也可以通过“函数即服务”作
为函数执行。
事件流和微服务的组合形成了贯穿整个组织的业务活动的相连图。传统的计算机体系结构
由多个单体应用和单体应用间的通信组成,具有相似的图形结构。这两种图形结构如图
1-1
所示。
事件驱动型微服务
单体应用 ...
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

监控运维实践:原则与策略

监控运维实践:原则与策略

Mike Julian
Kafka权威指南

Kafka权威指南

Neha Narkhede, Gwen Shapira, Todd Palino
Web容量规划之美

Web容量规划之美

Arun Kejariwal, John Allspaw

Publisher Resources

ISBN: 9787115571106