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

微服务与事件驱动架构

by Adam Bellemare
October 2021
Beginner to intermediate
250 pages
7h 11m
Chinese
Posts & Telecom Press
Content preview from 微服务与事件驱动架构
为什么用事件驱动型微服务
15
API
版本和依赖管理
多个
API
定义和服务版本通常需要同时存在
。强制让客户端升级到最新的
API
并不总是可
行或可取的。这会增加跨多个服务协调
API
更改请求的复杂性
,特别是当它们伴随着对底
层数据结构的更改时。
数据访问耦合于实现
同步的微服务在访问外部数据时会遇到所有跟传统的服务相同的问题。虽然有减少访问外
部数据需求的服务设计策略,但微服务通常还是需要访问来自其他服务的通用数据。这就
把数据访问和可伸缩性的责任重新放在了实现沟通结构上。
分布式的单体应用
服务可以被组合成一个分布式的单体应用,在它们之间进行许多相互交织的调用。这种情
况通常出现在团队分解一个单体应用,并决定使用同步的点到点调用来模拟这个单体应用
内部的边界时。点对点的服务可以很容易地模糊界限上下文的边界,因为对远程系统的函
数调用可以一行一行地插入现有单体式代码。
测试
集成测试可能很困难,因为每个服务都需要完全可操作的依赖项,而这些依赖项又需要自
己的依赖项。在单元测试中将它们截取出来可能是可行的,但并不足以满足更广泛的测试
需求。
1.7.2
 同步式微服务的优点
同步式微服务有许多不可否认的优点。一些数据访问模式很适合直接的“请求
响应”耦
合,比如验证用户身份和
AB
测试中的上报
。与外部第三方解决方案的集成大多数时候使
用同步机制,并且通常使用
HTTP
以提供一种灵活的、与语言无关的通信机制。
跟踪跨多个系统的操作在同步环境下会比异步环境下更简单。详细的日志可以显示在哪些
系统上调用了哪些函数,从而实现业务操作的高度可调试性和可见性。 ...
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