Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. Domain-Driven Design
  3. Event Sourcing and CQRS Examples

Event Sourcing and CQRS Examples

MITJava

A practical example of Event Sourcing and CQRS patterns applied to a minimalistic banking domain.

GitHubGitHub
599 stars122 forks0 contributors

What is Event Sourcing and CQRS Examples?

Event Sourcing and CQRS Examples is a Java-based demonstration project that implements Event Sourcing and Command Query Responsibility Segregation patterns in a minimalistic banking context. It provides a working codebase to understand how these architectural patterns handle state changes as immutable events and separate read and write models. The project solves the problem of learning these complex patterns through abstract documentation by offering a concrete, runnable example.

Target Audience

Software architects and backend developers who want to understand or implement Event Sourcing and CQRS patterns in their applications. It's particularly useful for those working on systems requiring audit trails, temporal queries, or complex domain logic.

Value Proposition

Developers choose this project because it provides a complete, working example rather than just theoretical explanations. It demonstrates practical considerations like idempotent event replay, event ordering, and how to combine DDD with REST, which are often glossed over in conceptual discussions.

Overview

Event Sourcing and CQRS in practice.

Use Cases

Best For

  • Learning how Event Sourcing works in a real codebase
  • Understanding CQRS implementation patterns and trade-offs
  • Studying how to combine DDD with Event Sourcing architectures
  • Exploring idempotency and event ordering in distributed systems
  • Building educational examples for team training on these patterns
  • Reference implementation for banking or financial domain modeling

Not Ideal For

  • Projects requiring a production-ready framework with built-in scalability, security, and monitoring
  • Teams building simple CRUD applications where event sourcing overhead is unnecessary
  • Developers seeking a drop-in library or tooling for immediate Event Sourcing/CQRS implementation without deep customization

Pros & Cons

Pros

Practical Learning Resource

Provides a complete, runnable Java codebase for Event Sourcing and CQRS, demonstrating patterns like idempotent event replay and explicit ordering in a banking context.

Idempotent Event Handling

Ensures safe event replay by assigning values instead of executing business logic, as shown with deposit events where balance is directly assigned.

Explicit Event Ordering

Uses event versioning for optimistic locking and handling out-of-order events in distributed scenarios, addressing real-world concurrency issues.

DDD and REST Integration

Demonstrates how Domain-Driven Design can be combined with RESTful APIs using Ports and Adapters, debunking myths of incompatibility.

Cons

Limited Production Features

Omits critical production aspects like advanced error handling, scalability mechanisms, and REST hypermedia controls, as admitted in the README.

Assumes Prior Knowledge

Requires familiarity with Event Sourcing and CQRS concepts, and setup with Java 14 and Maven, making it less accessible for beginners.

Pragmatic CQRS Deviation

Deviates from strict CQRS by allowing some queries in the domain model, which may confuse users seeking textbook separation of reads and writes.

Frequently Asked Questions

Quick Stats

Stars599
Forks122
Contributors0
Open Issues0
Last commit1 day ago
CreatedSince 2017

Tags

#software-architecture#cqrs#event-store#event-sourcing#distributed-systems#rest-api#domain-driven-design#ddd#java#cqrs-es#ports-and-adapters#hexagonal-architecture#projections#events

Built With

M
Maven
J
Java

Included in

Domain-Driven Design12.2k
Auto-fetched 1 day ago

Related Projects

DDD By Examples - LibraryDDD By Examples - Library

A comprehensive Domain-Driven Design example with problem space strategic analysis and various tactical patterns.

Stars5,873
Forks832
Last commit19 days ago
DDDSampleDDDSample

This is the new home of the original DDD Sample app (previously hosted at sf.net)..

Stars5,292
Forks1,496
Last commit1 year ago
IDDD SamplesIDDD Samples

These are the sample Bounded Contexts from the book "Implementing Domain-Driven Design" by Vaughn Vernon: http://vaughnvernon.co/?page_id=168

Stars3,945
Forks917
Last commit3 years ago
DDD LeavenDDD Leaven

DDD-CqRS sample v2.0 project that helps you with starting out advanced domain modeling using Spring, JPA and testing

Stars881
Forks248
Last commit2 years ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub