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

微服务与事件驱动架构

by Adam Bellemare
October 2021
Beginner to intermediate
250 pages
7h 11m
Chinese
Posts & Telecom Press
Content preview from 微服务与事件驱动架构
158
12
使用轻量级框架的微服务
轻量级框架提供了与重量级框架相似的功能,但是是通过大量使用事件代理和
CMS
的方
式来实现的。与重量级框架不同,轻量级框架没有额外的专用资源集群来管理框架专用的
资源。水平伸缩、状态管理和故障恢复是由事件代理和
CMS
提供的
。跟所有
BPC
微服务
一样,应用程序会作为单独的微服务被部署。并行度由消费者组的成员情况和分区所有权
情况决定。当新的应用程序实例加入和离开消费者组时,分区将重新分配(包括协同分区
的分配)。
12.1
 优点和局限性
轻量级框架提供的流处理特性可与重量级框架相媲美,而且在许多情况下超过了后者。将
流物化到表,加上简单的开箱即用的联结功能,使得处理流以及其中的相关数据变得相当
简单。虽然表的物化功能不是轻量级框架所特有的,但是它的易用性预示着轻量级框架可
以解决复杂的有状态的问题。
通过使用内部事件流,轻量级模型依赖事件代理来提供数据局部性和协同分区的机制。事
件代理还通过使用变更日志来充当微服务内部状态的持久存储机制,如
7.2
节所述
。通过
使用
CMS
,你可以像部署任何其他的事件驱动应用程序一样部署轻量级微服务
。你可以简
单地通过添加和移除实例来调整应用程序的并行度,使用
CMS
来提供伸缩和故障管理机
制。图
12-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