Dynamic Consistency Boundary (DCB) in Axon Framework 5 - Event Sourcing That’s Adaptable
Today, I’m happy to announce that Axon Framework 5.0 now includes support for Dynamic Consistency Boundary (DCB for short)!
For everyone here at AxonIQ, this marks a major and exciting milestone. We’ve always been known as the company that makes Event Sourcing easy. With Dynamic Consistency Boundary, we’re making it more adaptable and resilient as well.
DCB gives your Event-Sourced applications a new level of flexibility—allowing them to evolve alongside your business without compromising consistency or performance.
To get started building with DCB, check out the full tutorial on our documentation site. And if you're using Axon Server, you'll be happy to know that the newly released Axon Server 2025.1 fully supports DCB for Framework 5 applications.
Not sure what DCB is or how to use it? Let’s break it down.
Dynamic Consistency Boundary makes Event Sourced applications more flexible
In enterprise software development, we all know that requirements change. Businesses grow, offerings shift, and new services get added. But with traditional Event-Sourced architectures, once you define your aggregates, you’re locked into those decisions for the life of the system.
That rigidity can lead to awkward workarounds—especially in distributed systems—when the architecture can’t keep up with evolving functional needs. It’s not uncommon to see dev teams implement ad hoc fixes just to bypass the architectural constraints of early aggregate definitions.
That’s exactly the kind of scenario Dynamic Consistency Boundary was designed to address.
DCB lets you define transactional consistency scopes dynamically, based on the operation at hand—all while staying within a bounded context. That means your system can evolve organically, without forcing you to re-architect or discard the events you’ve already stored.
Let’s say your app initially defines an “account” as a checking account. Later, your business adds savings accounts, loans, or brokerage services. With DCB, your definition of "account" can adapt without disruption, maintaining backward compatibility while expanding functionality.
DCB introduces the concept of a “temporary consistency bubble”: a boundary created on demand for a specific operation or transaction. It includes just the data you need, when you need it—ensuring correctness without the performance hit of locking down oversized transactional scopes.
The result? A system that’s not just technically robust, but also aligned with your business evolution.
We’re going backward and forward at the same time!
Axon Framework 5.0 reintroduces annotation-based aggregate modeling, making the upgrade smoother for existing projects. If you're coming from Axon Framework 4, this means less friction when adopting version 5—and better compatibility with your current services.
At the same time, we’ve layered in major architectural improvements. Framework 5 now supports both annotations and Java Builder-style modeling, so teams can choose the approach that best fits their philosophy—whether you prefer integration via annotations or clean separation of domain logic from framework concerns.
Immutable entities
One of the most impactful changes in Axon Framework 5.0 is the introduction of immutable entities. Previously, state changes in aggregates were made in place using stateful or event sourcing handlers. Now, those handlers can return new instances, enabling true immutability.
Why does this matter? Because immutable domain models are safer. They eliminate accidental state mutations inside command handlers and provide instant feedback in your IDE if something violates immutability rules. It’s a subtle shift that helps enforce architectural integrity at the code level.
We’ve implemented this using Java records, which is why Axon Framework 5 standardizes on Java 21.
Axon Framework 4 Migration Path and Spring Support
We know many teams have heavily invested in Axon Framework 4. That’s why Framework 5 includes migration-friendly features right out of the box.
While full migration tooling is still on the roadmap, this release offers a clear path forward. Thanks to the reintroduction of annotation support, most existing aggregates can function with minimal changes, giving teams access to features like DCB and immutability without starting from scratch.
We’ve also rebuilt Spring integration from the ground up. Rather than patching old APIs, we reimagined the configuration system to align with the architecture of Framework 5—using lessons learned from previous releases to create a simpler, more intuitive setup.
Other key updates include:
-
Handler and dispatch interceptor support using the async native API
-
Stateful event handling, enabling richer event-driven behavior
Together, these updates ensure Framework 5 is not only more powerful, but also practical for real-world migration.
Serialization and Converter Enhancements
While not as flashy, we’ve also made deep improvements to serialization and converters under the hood. These changes enhance the reliability, performance, and scalability of the framework—especially for systems dealing with complex or high-throughput event models.
These adjustments ensure Axon Framework 5 can support your application’s growth without turning serialization into a bottleneck.
Want to get started with DCB in Axon Framework 5? Download Axon Server 2025.1 (and beyond)
Axon Framework 5.0 is fully compatible with Axon Server 2025.1 and later. Even though DCB is still in an experimental phase, you can start trying it today with a fully supported setup.
We’re also publishing snapshot builds of Axon Server APIs and connectors—so if you want to contribute, test, or prototype with Framework 5 features, you don’t have to wait for the next release.
What does this mean for your team?
-
Start experimenting with DCB-based architectures
-
Evaluate your Axon 4 migration path
-
Help shape the final release by sharing your feedback
Download the latest versions of Axon Framework and Axon Server
Conclusion: A Framework Evolving with Your Needs
Axon Framework 5.0 is more than a version bump—it’s a foundational evolution. With features like Dynamic Consistency Boundary, immutable aggregates, and dual-mode modeling, this release solves long-standing architectural challenges without abandoning the patterns that work.
We encourage you to explore, test, and share your insights. Post your experiences on the AxonIQ Discuss site—your feedback is key to shaping the final release.
Whether you’re building new systems or modernizing old ones, Axon Framework 5.0 gives you the tools and flexibility to create more resilient, maintainable, and high-performance distributed applications.
This is just the beginning—stay tuned for even more exciting updates, docs, and videos to help you get the most out of Framework 5. Whether you’re a veteran Axon developer or trying Event Sourcing for the first time, we’re here to help you succeed.
Looking for help on jumpstarting your event-sourced app with Axon Server? Feel free to use this form to book a chat with one of our solution architects to let us know what you’re working on. We’ll happily to show you step-by-step on getting your project off the ground. We’re happy to help your organization adapt to event sourcing, so feel free to contact us!
