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

微服务与事件驱动架构

by Adam Bellemare
October 2021
Beginner to intermediate
250 pages
7h 11m
Chinese
Posts & Telecom Press
Content preview from 微服务与事件驱动架构
214
15
测试中的系统没有得到必要的隔离。例如,同时运行大规模性能测试的服务会影响
彼此的结果。
不兼容的事件可能会生成到其他服务的输入事件流中。
事件流数据不可避免地变得过时,必须用较新的事件更新。
不能准确地表示在生产环境中出现的事件的范围。
就可用性而言,这种策略是最糟糕的选择,因为事件代理最终会成为混乱的
事件流和损坏的数据的垃圾场。
在使用这种方案时,要做到与其他应用程序测试隔离是很难的,特别是当一个微服务的输
出流是另一个微服务的输入流时。谨慎管理的数据流、严格的命名约定以及对写入事件流
的限制有助于缓解这些缺点,但环境维护人员和用户需要勤勉工作并遵守纪律。
15.7.3
 使用生产环境进行测试
你也可以在生产环境中测试微服务。微服务可以运转起来、从输入事件流中消费、应用业
务逻辑并产生输出。最常见的方法是让微服务使用自己指定的输出事件流和状态存储,这
样就不会影响现有的生产系统。当一个微服务的旧版本与测试中的新版本同时运行时,这
一点尤为重要。
优点
你能完全访问生产事件。
其利用生产环境的安全模型来确保遵循正确的访问协议。
非常适用于应用程序的冒烟测试。
不需要维护单独的测试环境。
缺点
有影响生产环境功能的风险,特别是当负载很高时。不适用于负载和性能测试。
必须仔细清除在测试期间创建的资源,比如事件流、消费者组、访问控制权限和状
态存储。这类似于共享临时环境方案的要求。
需要工具支持来保证处于测试中的微服务和事件流与“真正的生产”微服务隔离,
特别是当要执行长期测试时。这包括用于管理和部署微服务的资源,因为生产环境 ...
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