Leanpub Header

Skip to main content

Event-Driven Systems at the Edge

Streams, Queues and Distributed State

Event-Driven Systems at the Edge
This book is 100% completeLast updated on 2026-10-13

Building event-driven systems that work across cloud and edge environments is no small feat. This book takes you through the architecture, code and practical trade-offs behind reliable streaming, message delivery and distributed state, with a working application you can build on and adapt to your own projects.

Minimum price

$25.00

$35.00

You pay

Author earns

$

Also available for 1 book credit with a Reader Membership

PDF
EPUB
WEB
APP
About

About

About the Book

This book shows you how to design, build, deploy and operate production-grade event-driven applications that span cloud data centers and edge nodes. You will learn the architecture and internals of modern streaming platforms, how to guarantee message delivery under failure conditions, how to manage distributed state correctly and how to stitch all of this into a single coherent system. A complete reference application runs throughout the chapters, with working code, infrastructure definitions and deployment instructions you can adapt to your own projects.

Share this book

Author

About the Author

Steve Publications

Steve is a technology professional with over 20 years of experience in software development, server infrastructure, cybersecurity, vulnerability research and reverse engineering. He specializes in analyzing complex systems, identifying weaknesses and improving security.

Beyond his professional work, Steve collaborates with researchers and industry experts to create practical technical books covering software development, cybersecurity, cloud computing, DevOps, AI and enterprise technologies. His goal is to help IT professionals, students and enthusiasts develop practical skills through clear explanations, real-world examples and hands-on exercises.

At Steve Publications, we use AI to assist with translation, proofreading and editing but not to replace the research, technical expertise or hands-on experience behind our books. Some authors publish under pseudonyms for privacy or professional reasons.

Every book is written, reviewed and maintained by experienced professionals, supported by a private community of over 420 engineers and researchers. We prioritize technical accuracy, practical value and regularly updated content over mass-produced AI-generated text.

We welcome experienced professionals interested in writing or reviewing books, especially in specialized and emerging technology fields. If you'd like to contribute, contact us with your area of expertise.

We stand behind our work. If a book doesn't meet your expectations, Leanpub offers a 60-day money-back guarantee.

Contents

Table of Contents

Streams, Queues and Distributed State

Introduction

  1. What You Will Learn
  2. The Reference Application: EdgeFleet
  3. Technology Stack
  4. How to Use This Book
  5. What This Book Does Not Cover

Chapter 1: Why Event-Driven? The Promise and the Peril

  1. The Connected World at Scale
  2. From Monolith to Events
  3. The Cost of Getting It Wrong
  4. What This Book Will Build
  5. How to Read This Book

Chapter 2: Event-Driven Architecture Foundations

  1. Events, Messages and Commands
  2. The Producer-Consumer Model
  3. Point-to-Point Versus Publish-Subscribe
  4. Coupling, Cohesion and Autonomy
  5. Anti-Patterns and Common Mistakes

Chapter 3: Message Brokers, Queues and Streams

  1. Queues: Load Leveling and Work Distribution
  2. Topic-Based Pub/Sub: Broadcasting and Filtering
  3. Event Streams: Ordered, Persistent, Replayable
  4. Broker Architectures: From RabbitMQ to Kafka to NATS
  5. Choosing a Messaging Primitive

Chapter 4: Kafka Internals and Architecture

  1. Topics, Partitions and Offsets
  2. The Broker and Controller
  3. Replication and ISR
  4. Producer Semantics and Batched Writes
  5. Consumer Groups and Offset Management
  6. Log Compaction and Retention
  7. Summary

Chapter 5: NATS, Pulsar and Cloud-Native Alternatives

  1. NATS and JetStream: Simplicity and Speed
  2. Apache Pulsar: Multi-Tenant Cloud Scale
  3. Managed Cloud Services: Kinesis, Pub/Sub, Event Hubs
  4. Brokerless and Mesh Architectures
  5. Platform Selection Matrix
  6. Summary

Chapter 6: Events, Schemas and Serialization

  1. Designing Domain Events
  2. Serialization Formats: JSON, Protobuf, Avro
  3. Schema Registry and Evolution Rules
  4. Backward and Forward Compatibility
  5. Summary

Chapter 7: Producers - Publishing Events Reliably

  1. Producer Design Patterns
  2. Kafka Producer Configuration
  3. Idempotent Producers
  4. Ordering Guarantees and Key-Based Routing
  5. Reference application: EdgeFleet producers
  6. Error Handling and Retries
  7. Summary

Chapter 8: Consumers - Processing Events Correctly

  1. Consumer Group Dynamics
  2. At-Least-Once and At-Most-Once Consumption
  3. Idempotent Consumers and Deduplication
  4. Backpressure and Graceful Degradation
  5. Reference Application: EdgeFleet Consumers
  6. Summary

Chapter 9: Stream Processing - Transformations and Joins

  1. Map, Filter and Aggregate
  2. Tumbling, Sliding and Session Windows
  3. Stream-Stream and Stream-Table Joins
  4. Stateful Processing and Checkpoints
  5. Reference Application: The Stream Processor

Chapter 10: Kafka Streams and Flink

  1. Kafka Streams: Embedded and Lightweight
  2. Apache Flink: Batch-and-Stream Unified
  3. State Stores and RocksDB
  4. Fault Tolerance and Recovery
  5. When to Use Which
  6. Summary

Chapter 11: Event Sourcing and CQRS

  1. Command Query Responsibility Segregation
  2. Event Sourcing: Appending the Truth
  3. Sagas and Distributed Transactions
  4. Read Models and Projections
  5. Reference Application: Event-Sourced Domain

Chapter 12: Distributed State Management

  1. Stateful Services in a Stateless World
  2. Distributed Caches and KV Stores
  3. Eventual Consistency and Conflict Resolution
  4. Partitioning State and Hot Keys
  5. Reference Application: Distributed State Store
  6. Summary

Chapter 13: Edge Computing Fundamentals

  1. Cloud, Fog and Edge: A Continuum
  2. Latency, Bandwidth and Autonomy
  3. Edge Runtimes: Containers, Functions and WASM
  4. Edge Deployment Models
  5. Reference Application: The Edge Topology
  6. Summary

Chapter 14: Serverless Event Processing

  1. Serverless Execution Models
  2. Cloud Functions: AWS Lambda, Cloudflare Workers, Azure Functions
  3. Edge Functions and CDNs
  4. Cold Starts, Limits and Workarounds
  5. Reference Application: Serverless Handlers
  6. Wrapping up

Chapter 15: Cloud-to-Edge Communication

  1. Edge-to-Cloud Patterns
  2. Store-and-Forward for Intermittent Connectivity
  3. Delta Sync and Operational Transformations
  4. Bi-Directional Event Routing
  5. Reference Application: Edge-to-Cloud Pipeline
  6. Summary

Chapter 16: Delivery Guarantees, Deep Dive

  1. At-Most-Once, At-Least-Once, Exactly-Once
  2. The Two-Phase Commit Problem
  3. Transactional Outbox Pattern
  4. Idempotent Operations: Making At-Least-Once Safe
  5. Reference Application: Transactional Messaging
  6. Summary

Chapter 17: Consistency, Ordering and Partitioning

  1. CAP and the PACELC Theorem
  2. Linearizability Versus Sequential Consistency
  3. Partition Key Design and Hot Spots
  4. Compensating for Disordered Events
  5. Reference Application: Consistency Choices
  6. Summary

Chapter 18: Fault Tolerance and Recovery

  1. Failure Modes in Distributed Systems
  2. Retries, Dead Letter Queues and Alerting
  3. Circuit Breakers and Bulkheads
  4. Leader Election and Raft
  5. Reference Application: Failure Handling
  6. Summary

Chapter 19: Observability and Operations

  1. Logging: Structure, Correlation and Volume
  2. Metrics: Red Signals and SLOs
  3. Distributed Tracing End to End
  4. Capacity Planning and Cost Control
  5. Reference Application: Observability Stack
  6. Summary

Chapter 20: Security, Secrets and Multi-Tenancy

  1. Authentication and Authorization Models
  2. TLS, mTLS and Encryption at Rest
  3. Secret Management Patterns
  4. Multi-Tenant Isolation and Quotas
  5. Reference Application: Security Layer
  6. Summary

Chapter 21: CI/CD, IaC and Deployment Automation

  1. Infrastructure as Code with Terraform
  2. Containerization and Kubernetes
  3. GitOps and Progressive Delivery
  4. Schema and Migration Pipelines
  5. Reference Application: Complete Deployment
  6. Summary

Chapter 22: Production Hardening and the Full System

  1. The Complete Reference Architecture
  2. Load Testing and Performance Validation
  3. Runbooks and On-Call
  4. Migrating from Monolith to Event-Driven
  5. What Comes Next

Conclusion

References

Get the free sample chapters

Click the buttons to get the free sample in PDF or EPUB, or read the sample online here

The Leanpub 60 Day 100% Happiness Guarantee

Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.

See full terms...

Earn $8 on a $10 Purchase, and $16 on a $20 Purchase

We pay 80% royalties on purchases of $7.99 or more, and 80% royalties minus a 50 cent flat fee on purchases between $0.99 and $7.98. You earn $8 on a $10 sale, and $16 on a $20 sale. So, if we sell 5000 non-refunded copies of your book for $20, you'll earn $80,000.

(Yes, some authors have already earned much more than that on Leanpub.)

Learn more about writing on Leanpub

Free Updates. DRM Free.

If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).

Most Leanpub books are available in PDF (for computers) and EPUB (for phones, tablets and Kindle). The formats that a book includes are shown at the top right corner of this page.

Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.

Learn more about Leanpub's ebook formats and where to read them

Write and Publish on Leanpub

You can use Leanpub to easily write, publish and sell in-progress and completed ebooks and online courses!

Leanpub is a powerful platform for serious authors, combining a simple, elegant writing and publishing workflow with a store focused on selling in-progress ebooks.

Leanpub is a magical typewriter for authors: just write in plain text, and to publish your ebook, just click a button. (Or, if you are producing your ebook your own way, you can even upload your own PDF and/or EPUB files and then publish with one click!) It really is that easy.

Learn more about writing on Leanpub