Many forces affect software today: larger datasets, geographical disparities, complex company structures, and the growing need to be fast and nimble in the face of change. Proven approaches such as service-oriented and event-driven architectures are joined by newer techniques such as microservices, reactive architectures, DevOps, and stream processing. Many of these patterns are successful by themselves, but as this practical ebook demonstrates, they provide a more holistic and compelling approach when applied together. Author Ben Stopford explains how service-based architectures and stream processing tools such as Apache Kafka can help you build business-critical systems. You'll learn how to apply patterns including Event Sourcing and CQRS, and how to build multi-team systems with microservices and SOA using patterns such as "inside out databases" and "event streams as a source of truth." These approaches provide a unique
AI Reading Assistant
Whole-book reading guide from stratified index samples; jump to passages in the text
Tip the Site
Support this siteYour recognition and a small knowledge-service contribution help keep this technical work open source.Scan the WeChat Pay or Alipay code below. Logged-in and guest visitors can both tip.
WeChat Pay
Alipay
Open WeChat or Alipay and scan. No login required.
AI guide
# Designing Event-Driven Systems: Concepts and Patterns for Streaming Services with Apache Kafka
## 【One-Line Pitch】
A practical guide for architects and senior developers who want to move beyond request-response thinking and build scalable, loosely coupled systems using event streams and Apache Kafka as the backbone. If you're wrestling with how to share data across services without tight coupling, or wondering how Event Sourcing and CQRS fit into modern architectures, this book gives you the conceptual framework and concrete patterns to make it work.
## 【Book Arc】
- **Opening (~0%–10%)**: Sets the stage by examining why modern software demands new architectural approaches—larger datasets, distributed teams, and the need for speed. The author introduces the core tension: services need autonomy, but they also need to share data effectively.
- **Early (~10%–23%)**: Builds the case for event-driven thinking by contrasting it with traditional database-centric and RPC-based designs. Drawing on Amazon's service model and ThoughtWorks' early experiments, the book shows how replayable event logs offer a fundamentally different way to structure systems.
- **Early (~23%–32%)**: Deconstructs what Kafka really is—not just a message broker but a streaming platform with storage, replication, and processing capabilities. The author clarifies common misconceptions by comparing Kafka to REST, service buses, and databases, explaining where each analogy holds and where it breaks down.
- **Middle (~32%–48%)**: Dives into the Kafka broker's architecture, covering the log structure, linear scalability, ordering guarantees, durability through replication, and advanced features like compacted topics and long-term storage. This section also introduces the foundational vocabulary of commands, events, and queries, and how they differ in coupling and side effects.
- **Middle (~48%–end)**: Moves into practical patterns for building streaming services, including how to structure multi-team systems, apply Event Sourcing and CQRS, and use Kafka Streams for stateful processing. The book culminates in guidance on designing services that treat event streams as a source of truth.
## 【Key Takeaways】
- **Events are the key to loose coupling** (Early): Unlike commands or queries, events carry no expectation of a response and can serve both as notifications and as a replication mechanism. This dual nature lets services share data without tight dependencies, making systems easier to evolve independently.
- **Kafka is not your grandfather's message broker** (Early): It inherits more from distributed storage systems like HDFS and Cassandra than from JMS or AMQP brokers. This means high throughput, linear scale-out, and durability are built into its DNA—not bolted on as afterthoughts.
- **The log is the fundamental abstraction** (Middle): Kafka's efficiency comes from treating messages as an append-only log spread across machines. This simple structure enables ordering guarantees, replayability, and the ability to push whole datasets to wherever they're needed.
- **Replication is how Kafka achieves durability** (Middle): With a replication factor of three, you can lose two machines without losing data. For sensitive service-based applications, configure three replicas per partition and make producers wait for replication to complete.
- **Ordering is a configurable trade-off** (Middle): Kafka provides key-based ordering within partitions, but global ordering requires a single partition topic—which limits throughput to a single machine. Understanding this trade-off is essential when migrating from legacy systems that assumed global ordering.
- **Compacted topics solve the "latest state" problem** (Middle): When you need the current version of data rather than full history, compacted topics reduce storage footprint significantly. The "latest-versioned pattern" combines regular and compacted topics to get both audit trail and efficient lookups.
- **Kafka can be a storage layer, but it's not a database** (Middle): It's common to see retention-based or compacted topics holding over 100 TB, but Kafka offers no broad query functionality. Its simple contract makes it ideal for shared datasets and event sourcing, not for ad hoc queries.
- **ESB-style centralization is a trap** (Early): While Kafka may look like an enterprise service bus, the pattern works only when it stays simple and doesn't become a central orchestration point controlled by a single team. Streaming encourages services to retain control of their data.
## 【Reading Tips】
- **Skim the first two chapters** (~0%–10%) if you're already familiar with microservices and SOA—they set up the problem but move slowly for experienced architects. The real value starts when the author contrasts event-driven with request-response thinking.
- **Deep-read Chapter 4** (~32%–48%) on the Kafka broker. This is where the practical details live: replication factors, ordering configurations, retry semantics, and storage patterns. These decisions directly impact your system's reliability and performance.
- **Pay special attention to the commands/events/queries distinction** (~48%): This vocabulary is the foundation for everything that follows. Understanding when to use each interaction type—and their coupling implications—will shape your entire architecture.
- **Don't skip the comparisons to REST, ESBs, and databases** (~29%–32%): These analogies help clarify what Kafka is and isn't, preventing the common mistake of treating it like a traditional message broker or trying to use it as a general-purpose database.
- **Take notes on the storage patterns** (Middle): The distinction between regular topics, compacted topics, and the latest-versioned pattern is subtle but crucial. These choices affect both your storage costs and your ability to reconstruct state.
## 【Coverage Limits】
The excerpts cover roughly the first half of the book in depth—the conceptual foundation, Kafka broker internals, and interaction patterns. Detailed guidance on Kafka Streams, KSQL, and the later chapters on building streaming services and multi-team architectures is only partially represented in the source material.
##
Page 4
. . . . . . . . . . 13 Kafka Is Like REST but Asynchronous? 13 Kafka Is Like a Service Bus? 14 Kafka Is Like a Database? 15 What Is Kafka Really? A Streaming...
ents and watching the “narrative” of the system whizz past. A few years later, I was working at a large financial institution that wanted to build a data ser...
cuss in Chapter 9. Both of these represent sensible advice. So Kafka may look a little like an ESB, but as we’ll see throughout this book, it is very differe...
tion. Client authentication is provided through either Ker‐ beros or Transport Layer Security (TLS) client certificates, ensuring that the Kafka cluster know...
Figure 5-9. Online services interact directly with a user, say with REST, but also journal state changes to Kafka (see “Event Sourcing, Command Sourcing, and...
ggers can be applied in many relational databases to create audit tables, and Bitemporal databases also provide an auditable data structure. These are all us...
software we also consider the future—not by staring into a crystal ball in some vain attempt to predict what our company will need next year, but rather by f...
kind of event store: part messaging system, part database. Messaging turns highly coupled, shared datasets (data on the outside) into data a service can own...
Support this siteYour recognition and a small knowledge-service contribution help keep this technical work open source.
Scan the WeChat Pay or Alipay code below. Logged-in and guest visitors can both tip.
WeChat PayAlipay
Open WeChat or Alipay and scan. No login required.
Add Tag
Enter tag name (max 50 characters)
Share E-Book
Designing Event-Driven Systems Concepts and Patterns for Streaming Services with Apache Kafka (Ben Stopford)(Z-Library)
Scan QR code with your phone to access
Copy the link or scan the QR code to access this e-book on your phone
Share E-Book via Email
Please enter email address
Donation Statistics
¥.00
Total Donations
0
Donation Count
Designing Event-Driven Systems Concepts and Patterns for Streaming Services with Apache Kafka (Ben Stopford)(Z-Library)
Find Your Favorite Books
Only registered users can comment after logging in. Comments need to be reviewed by administrators before being displayed
Loading comments...
Reply to Comment
Edit Comment