Share E-Book
Scan to open this page

Scan with your phone to open this page

Author: Adam Bellemare

Event-driven microservices offer an optimal approach to harnessing event streams, reacting and responding to changes as they occur across your company. With this fully revised and updated guide, you’ll learn how to apply the principles of event-driven architecture to create event streams and build powerful microservice applications. Author Adam Bellemare takes you through the process of creating event-driven microservice architectures, from first principles all the way to advanced applications. Covering events, event streams, and microservices, this book will give you powerful and reusable patterns for sharing and using important data all across your organization. The theory and principles of event-driven architectures How to design and build event-driven microservice architectures to deliver exceptional business value Event and event-stream design patterns, including schemas and evolution through time Microservice application patterns, both as singular services and as a collection of multiple services Tooling and techniques to get your event-driven microservice ecosystem off the ground and set yourself up for success Integrating event-driven applications into your existing architecture

AI Reading Assistant

Whole-book reading guide from stratified index samples; jump to passages in the text

AI guide
# Building Event-Driven Microservices, 2nd Edition — Reading Guide 【One-Line Pitch】 A practical, pattern-rich guide for architects and engineers who want to design event-driven microservice systems that share organizational data at scale, covering everything from first principles to advanced stream-processing techniques. If you're building with Kafka or similar event brokers and want to move beyond toy examples, this book is your field manual. 【Book Arc】 - **Opening (~0%–9%)**: Establishes the core value proposition of event-driven microservices versus request-response architectures, with a foreword by Martin Kleppmann setting the philosophical stage around events as the backbone of scalable, decoupled systems. - **Early (~16%–28%)**: Contrasts request-response and event-driven approaches in depth, covering the drawbacks of point-to-point coupling, then introduces queue brokers, consumer groups, and the lambda/kappa architecture debate, ending with the first concrete microservice example in Python. - **Early-to-Middle (~34%–44%)**: Moves into implementation fundamentals—microservice responsibilities, the "microservice tax" of non-business overhead, deployment considerations, and a deep dive into event schemas using Avro and Protobuf, including code generation across languages. - **Middle (~44%–53%)**: Focuses on schema registries as data contracts, compatibility modes (backward/forward), and event design strategies—particularly state events versus delta events, with trade-offs for compaction and consumer inference. 【Key Takeaways】 - **Event-driven beats request-response for scale** (Early): Point-to-point couplings create excessive fanout and tangled dependency graphs; event streams decouple producers from consumers and make tracing business logic far easier. The book is honest that both styles have their place, but makes a strong case for events as the default. - **Queues and streams solve different problems** (Early): Queues offer at-least-once processing and priority ordering but struggle with multiple independent consumers; durable event streams let each consumer read the same logical record independently. Choose based on whether you need fan-out or work distribution. - **Lambda architecture has a hidden trap** (Early): Writing to both a historical store and an event stream independently causes divergence—consumers get different results depending on which source they read. The fix is to build historical data *from* the stream, which effectively collapses lambda into kappa. - **The "microservice tax" is real** (Early): All the non-business work—deployment, monitoring, debugging, state management—adds up. The advice is pragmatic: use what you already have, work incrementally, and don't treat microservices as an all-or-nothing decision. - **Schemas are your data contract** (Middle): Avro and Protobuf with code generators support nearly every major language (Rust, Go, Java, Python, C++, C#, and more). A schema registry validates producer changes, protects stream integrity, and provides auto-updated documentation. - **Compatibility modes determine evolution freedom** (Middle): Backward compatibility lets new consumers read old data; forward compatibility lets old consumers read new data. The book shows concrete examples of when a schema change breaks compatibility—like adding a field without a default value—and why that matters for consumers rewinding offsets. - **State events vs. delta events is a fundamental design choice** (Middle): State events (current or before/after) allow consumers to infer changes by comparison and work well with compaction; delta events are theoretically infinite in variety and require every consumer to understand every event type. The book strongly cautions against the delta model. 【Reading Tips】 - **Skim the foreword and Chapter 1** (~0%–9%) if you're already convinced about event-driven architecture; they're motivational and contextual, not technical. Jump straight to the queue/stream comparison around ~19% for the first substantive content. - **Deep-read the schema chapters** (~38%–47%): The compatibility discussion and registry patterns are the most reusable knowledge in the book. Pay special attention to the concrete Avro/Protobuf examples—they clarify abstract concepts quickly. - **The Python example at ~28% is your anchor**: Work through it carefully even if Python isn't your language. It establishes the producer/consumer mental model that all later patterns build on. - **Watch for the lambda/kappa discussion** (~25%): This is a subtle but critical architectural insight that many practitioners get wrong. The divergence problem is worth re-reading until it clicks. - **Take notes on the "microservice tax" section** (~34%): This is the most honest, practical advice in the book for teams deciding whether to adopt this architecture at all. 【Coverage Limits】 The excerpts cover roughly the first half of the book (through ~53%). Later content on copartitioning, state stores, watermarks, out-of-order events, and time-based processing is visible in the table of contents but not covered in this guide.
Page 9
176 Using a Changelog Event Stream as State Recovery 177 Materializing Global State 178 Advantages of Internal State Stores 179 Disadvantages of Internal Sta...
View in text
Excerpt 2
response microservices. Perhaps you’ll come to agree as you proceed through this book, but at the very least, you’ll gain an understanding of their strengths...
View in text
Excerpt 3
rvice 2 acts strictly as a consumer and provides a REST API in which data can be accessed synchronously. Meanwhile, microservice 3 performs its own transform...
View in text
Excerpt 4
the newer event has had its name, price, and stock updated. Your microservice can infer the changes that it cares about, and react accordingly. For example,...
View in text
Excerpt 5
coupling and dependencies spread across multiple services. While this chapter has discussed how to design events, the next chapter shows how to generate even...
View in text
Excerpt 6
orms that are more suitable for event-driven consumers. The end goal is to reduce the amount of repetitive, error-prone, and expensive denormali‐ zations tha...
View in text
Excerpt 7
ectively once processing in sys‐ tems without such support. Having covered state, it’s time to take a look at what happens when events are late or arrive out...
View in text
Excerpt 8
service can easily reprocess events from a stream, it can’t reprocess requests from other services that it has already failed and returned. You’ll usually fi...
View in text
Tags
AI categories
BackendCloud NativeProgramming
ISBN: 834162219X
Publisher: O'Reilly Media
Publish Year: 2025
Language: English
Pages: 448
File Format: PDF
File Size: 18.0 MB
Text Preview (First 20 pages)
Registered users can read the full content for free

Register as a Gaohf Library member to read the complete e-book online for free and enjoy a better reading experience.

Generating text preview…