Skip to main content

Event-Driven Architecture for Java Developers

Learn how to build Event-Driven systems with a Transactional Outbox and CockroachDB's CDC.

  • Course Number

  • Self-Paced

About This Course

Modern architectures are often built with a series of distributed microservices. They span multiple machines, often in different data centers. They communicate using asynchronous events that are pushed to a message queue. However, these systems face some key challenges. They’re built to be distributed, but they often run against non-distributed databases which limits elasticity and resilience. Meanwhile, those that run against distributed, nontransactional databases are faced with the problem of updating a message queue consistently with the state of the database. What if one of those operations fails?

This is where Distributed SQL comes in. CockroachDB provides us with a fully distributed database that includes support for transactions. It allows us to scale our database to match the needs of our system, but also to publish events from our microservices in a way that will be consistent and resilient to failures.

In this course, you’ll learn about the Dual-Write problem, and how you can use the Transactional Outbox Pattern to avoid it. You'll see some best practices and anti-patterns for working with Event-Driven systems. And you'll learn about some features of CockroachDB, such as Change Data Capture (CDC), that can simplify your architecture.

You'll be implementing these ideas using the Spring Data JPA framework, along with Spring Boot. You'll modify a series of microservices so that events emitted from one service can be consumed in another. And you'll do all of this using CockroachDB so that your system can scale from the database all the way through to the application.

Course Syllabus

  • Introduction
  • The Transactional Outbox Pattern
  • Publishing Events
  • Change Data Capture
  • Consuming Events
  • Best Practices
  • Wrap Up


  • Java
  • Spring Data
  • Spring Boot

Course Length

  • 2+ Hours

Course Staff

Wade Waldron
Wade Waldron
Senior Staff Curriculum Developer

Wade has been a Software Developer since 2005. He has worked on video games, backend microservices, ETL Pipelines, IoT systems and more.

He is an advocate for Test-Driven Development, Domain-Driven Design, Microservice Architectures, and Reactive Systems.

Today, Wade works as a Curriculum Developer at Cockroach Labs where he teaches people how to build modern applications on a distributed SQL database.