About This Title

Pages: 200
Published: February 2025
ISBN: 9798888651063
In Beta

Skill Level Meter

Real-World Event Sourcing

Distribute, Evolve, and Scale Your Elixir Applications

by Kevin Hoffman

Reality is event-sourced; your mind processes sight, sound, taste, smell, and touch to create its perception of reality. Software isn’t that different. Applications use streams of incoming data to create their own realities, and when you interpret that data as events containing state and context, even some of the most complex problems become easily solvable. Unravel the theory behind event sourcing and discover how to put this approach into practice with practical, hands-on coding examples. From early-stage development through production and release, you’ll unlock powerful new ways of clearing even the toughest programming hurdles.

eBook Formats:

  • PDF for desktop/tablets

  • epub for Apple Books, e-readers

  • mobi for Kindle readers

Get all eBook formats here for $26.95 (USD)

Add to Cart we accept visa, mastercard, amex, discover, paypal

This book is in Beta, final version expected Feb 2025

Beta Books: What do I get?


Our applications are bombarded with data. It’s hard enough to derive state from that data, let alone discover how we arrived at that state. With event sourcing you can treat the stream of data as a simple sequence of events that you use to construct whatever state you need. Event sourcing is more than events; it adds patterns, rules, and constraints to produce robust and easy-to-maintain systems. In this book, you’ll learn which rules can never be broken and which ones are flexible. By grounding yourself in theory, rules, and practical approaches, you’ll be able to build real-world, event-sourced applications.

Get your hands dirty with fundamental event-sourcing building blocks such as commands, aggregates, projectors, process managers, injectors, and notifiers. Combine these building blocks to produce elegant solutions to complex problems. Leave “hello world” far behind as you tackle the more advanced aspects of event sourcing that give you the confidence you need to run these applications in production. Leverage event sourcing to create distributed applications with ease; model and handle failure; and deal with replays, schema evolution, security, and much more.

This book doesn’t shy away from confronting the hard parts of event sourcing, instead giving you clear advice and examples for tackling the most difficult details.

Empower your applications with the full force of event sourcing today.

What You Need

You’ll need a computer preferably running MacOS, Linux, or WSL/Ubuntu on Windows. You’ll install everything else you need (such as Elixir and an event store) as you progress through the book.

Resources

Releases:

  • B2.0 2024/09/16
  • B1.0 2024/09/03

Contents & Extracts

Note: Contents and extracts of beta books will change as the book is developed.

  • Preface
    • Who Should Read This Book?
    • About This Book
    • How to Read This Book
    • Conventions Used in This Book
    • Online Resources
    • Let’s Get Started!
  • Building Your First Event-Sourced Application
    • Saying “Hello, Procedural World”
    • Building a Stateful and Imperative Calculator
    • Creating Your First Event Driven Calculator
    • Handling Errors by Modeling Failure
    • Working with Event Sourcing Aggregates
    • Wrapping Up
  • Separating Read and Write Models
  • Enforcing Perimeters with Injectors and Notifiers
    • Handling Input and Output in an Event Sourced World
    • Reacting to Injected Events
    • Notifying External Consumers
    • Introducing Cloud Events
    • Building a Flight Tracker with Injection and Notification
    • Wrapping Up
  • Exploring the Saga of the Process Manager
  • Building Event-Sourced Elixir Apps with Commanded
    • Deciding Where to Start
    • Introducing Lunar Frontiers
    • Creating the First Flow
    • Playing the Game
    • Wrapping Up
  • Building Resilient Applications with Event Stores
    • Evaluating Event and Projection Stores
    • Replaying Events
    • Capacity Planning
    • Exploring Event Store
    • Upgrading Lunar Frontiers
    • Adding Durable Projections to Lunar Frontiers
    • Wrapping Up
  • Evolving Event-Sourced Systems
    • Evolving Event Schemas
    • Evolving Aggregates
    • Evolving Projections and Projectors
    • Evolving Process Managers
    • Evolving Lunar Frontiers
    • Migrating Event Streams
    • Wrapping Up
  • Securing Event-Sourced Applications
    • Securing Event Streams
    • Securing Command Paths
    • Securing Projections and Component State
    • Supporting GDPR and the Right to Be Forgotten
    • Wrapping Up
  • Testing Event-Sourced Systems
    • Testing Aggregates
    • Testing Projectors
    • Testing Process Managers
    • Automated and Acceptance Testing
    • Wrapping Up
  • Modeling Discoverable Application Domains
    • Defining and Documenting Schemas
    • Modeling Event Flows
    • Modeling Case Study: Crafter Hustle
    • Wrapping Up
  • Scaling Up and Out
    • Reading Your Writes
    • Preparing for Disorder
    • Preventing Duplicate Processing
    • Event Sourcing at Scale with NATS
    • Wrapping Up
  • The Laws of Event Sourcing
    • All Events Are Immutable and Past Tense
    • Failure Events Should Not Change Aggregate State
    • All Data Required for Event Sourcing Primitives Must Be on Events
    • Work Is a Side Effect
    • All Projections must Stem from Events
    • Never Manage More Than One Flow Per Process Manager
    • Process Managers Must Not Read from Projections
    • Event Schemas Are Immutable
    • Different Projectors Cannot Share Projections
    • Never Test Internal State

Author

Kevin Hoffman is the Engineering Director for Cloud Services at Synadia, the company behind NATS, a popular messaging and streaming server. Kevin specializes in distributed applications and has made enough event sourcing mistakes on his own to fill a book with what he’s learned and experienced.

eBook Formats:

  • PDF for desktop/tablets

  • epub for Apple Books, e-readers

  • mobi for Kindle readers

Get all eBook formats here for $26.95 (USD)

Add to Cart we accept visa, mastercard, amex, discover, paypal

This book is in Beta, final version expected Feb 2025

Beta Books: What do I get?

Related Titles:

Skill Level Meter

About This Title

Pages: 200
Published: February 2025
ISBN: 9798888651063
Edition: 1
In Beta