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

微服务与事件驱动架构

by Adam Bellemare
October 2021
Beginner to intermediate
250 pages
7h 11m
Chinese
Posts & Telecom Press
Content preview from 微服务与事件驱动架构
有状态的流
93
内存方法可带来非常高的吞吐量并显著降低数据访问瓶颈。
3.
使用网络连接磁盘的灵活性
微服务也可以使用网络连接的磁盘代替本地磁盘,这会显著增加读
/
写延迟
。由于通常必
须一次处理一个事件以保持时间顺序和偏移顺序,因此单个处理线程将花费大量时间等待
/
写响应
,这导致每个处理程序的吞吐量明显较低。对不需要高性能处理的有状态服务
来说,这通常是可以的,但是如果事件量很大,则可能会出现问题。
访问存储在网络连接的磁盘上的“本地”数据要比访问存储在系统内存或物理连接的磁盘
上的本地数据有更高的延迟。虽然配置本地
SSD
RocksDB
预估有
154 000
个请求
/
秒的
吞吐量,但是如果引入往返时间只有
1
毫秒
的网络延迟,对于相同的访问模式,也会将吞
吐量上限降至只有
939
个请求
/
。虽然可以使用并行访问来减小这个差距,但要记住事
件的消费和处理必须按偏移量的顺序进行,因此在许多情况下并不能执行并行操作。
网络连接磁盘的一个主要优点是可以在数据卷中维护状态,并根据需要迁移到新的处理硬
件。当处理节点恢复时,可以重新连接网络磁盘,并且在停止的位置继续处理,而不是从
变更日志流重建。这大大减少了中断时间,因为状态不再像本地磁盘那样完全是短暂的,
而且当你使用廉价的按需节点时,还增加了微服务跨计算资源迁移的灵活性。
7.3.3
 使用内部状态的缺点
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