finds.dev← search

// the find

ddd-by-examples/all-things-cqrs

★ 603 · Java · updated Apr 2019

Comprehensive guide to a couple of possible ways of synchronizing two states with Spring tools. Synchronization is shown by separating command and queries in a simple CQRS application.

A teaching repo that shows six different ways to sync command and query sides in a CQRS Spring Boot app, from the trivial (one class) to the heavy (Debezium + Kafka + MySQL transaction log tailing). The domain is intentionally tiny — a credit card with a withdraw command and a withdrawal query — so the infrastructure choices are the whole point. Aimed at Java developers trying to understand the tradeoff spectrum before picking an approach.

Each module is a self-contained Spring Boot app you can actually run, not just pseudocode. The progression from explicit synchronization to event-driven to CDC makes the tradeoff ladder clear and concrete. The Debezium/Kafka module is the rare example that shows transaction log tailing end-to-end with docker-compose, which most tutorials hand-wave. Tests are written at the right level — E2E where sync is in-process, unit-of-sink where it isn't, with honest commentary about why full E2E isn't worth it for async flows.

Last touched in 2019, so Spring Boot versions are ancient (pre-2.x in places), Spring Cloud Stream's API has changed significantly, and the Kafka setup requires manually hardcoding your host IP in docker-compose — a setup smell that breaks on anyone's machine. There's no discussion of failure modes: what happens if the Kafka consumer is down when an event is published, or if the DB trigger fires but the read model write fails. The domain is so simple it never forces the interesting decisions — no aggregate boundaries, no eventual consistency user-facing consequences, no retry/idempotency. The Axon section is just a link to another repo.

View on GitHub →

// want more like this?

We dig through GitHub every week and send a few repos picked for what you actually care about — each with an honest take like this one.

Get finds in your inbox → Search again →