Welcome to Ocoda Event Sourcing
Ocoda Event Sourcing is a powerful library designed to simplify the implementation of advanced architectural patterns in your NestJS application. It provides essential building blocks to help you implement Domain-Driven Design (DDD), leveraging Event Sourcing and CQRS to tackle the complexities of modern systems.
Whether you’re building microservices, event-driven systems, or simply want a clean and scalable architecture, this library offers the tools you need to create maintainable, business-aligned solutions.
Why Use Ocoda Event Sourcing?
Section titled “Why Use Ocoda Event Sourcing?”While NestJS provides the @nestjs/cqrs library for basic CQRS functionality, Ocoda Event Sourcing goes beyond by focusing on Domain-Driven Design and offering deeper integration with Event Sourcing. It gives you a more feature-rich framework to tackle complex business logic, ensure consistency, and manage state in a more scalable and flexible way.
Key Features:
Section titled “Key Features:”- Domain-Driven Design (DDD): Implement core DDD principles with ease, including aggregates, value objects, and repositories.
- CQRS (Command Query Responsibility Segregation): Cleanly separate the responsibility of handling commands and queries, with typed command and query buses.
- Event Sourcing: Capture every change in your system as an immutable event, allowing you to rebuild the entire state and maintain a full audit trail. Every event gets a global position, so projections and other consumers can read all events in order and resume from a checkpoint.
- Stores for PostgreSQL, MariaDB, MySQL and MongoDB (MySQL through the MariaDB store, from 4.1), in-memory stores for tests, and the conformance suites that every store runs, for your own stores.
What You’ll Find Here
Section titled “What You’ll Find Here”This documentation is focused on guiding you through using the library to implement DDD, Event Sourcing, and CQRS in your NestJS projects. While it doesn’t dive deeply into explaining these concepts, we provide:
- Step-by-step usage guides to help you integrate the library seamlessly into your application.
- A brief overview of the core patterns—DDD, CQRS, and Event Sourcing—in the Patterns section for those who need a quick refresher.
- A curated list of resources for deeper learning on the Further Reading page.
Get Started
Section titled “Get Started”Ready to dive in? Head over to the Getting Started guide and begin implementing a scalable and maintainable architecture for your NestJS application with Ocoda Event Sourcing.
Prefer to start from working code? The example application is a small NestJS 12 app on PostgreSQL, with aggregates, typed commands and queries, snapshots, subscribers, a publisher and an end-to-end test. Its README starts it with docker compose in three commands.
MIT 2026 © Ocoda.