Appearance
Introduction
Welcome to the flux framework documentation!
flux is a lightweight, high-performance, and strictly-typed Event Sourcing & CQRS framework for Go 1.27+. It is designed to provide you with the architectural benefits of distributed event sourcing without the immense boilerplate usually associated with it.
Why flux?
Most Go event-sourcing libraries rely heavily on reflect to decode events, map handlers, and hydrate aggregates. This introduces significant runtime performance penalties and completely bypasses the compiler's type safety.
flux was built from the ground up to leverage Go 1.20+ Generics.
By utilizing strict generic constraints on Aggregates and explicitly typed decoding mechanisms, flux ensures that if your event-sourced application compiles, it is fundamentally sound.
Core Principles
- Reflection-Free: Generics are used everywhere. Your command handlers, queries, and aggregates are statically typed.
- Framework Decoupling: Business logic is entirely isolated. Aggregates have zero knowledge of databases, Event Stores, or network boundaries.
- Bring Your Own Backend:
fluxships with a blazing-fast In-Memory testing backend, but allows you to seamlessly swap to MySQL, Redis, or PostgreSQL via a cleanEventStoreinterface.
Next Steps
Head over to the Installation guide to add flux to your Go module, and then dive into the Quick Start to build your first event-sourced Todo application!
