Cloud Parts

Axon Framework

A Java framework, not a database, for building event-sourced applications with CQRS and domain-driven design: commands, events and queries as messages, plus an event store to keep the events in.

Type
Open source
Made by
Axoniq
License
Apache 2.0; the Axoniq Framework modules on top of it are commercial and need a subscription for production
Facts checked
8 October 2026

What it is

Axon Framework is a library you add to a JVM application. It is not a database: it gives you the building blocks for domain-driven design, CQRS and event sourcing, namely entities, command, event and query buses, an event store abstraction, event processors and test fixtures, and stores the events through a storage engine you configure. Its makers say its main feature is location transparency: components only exchange messages, so a handler can move to another service without its callers changing.

An event-sourced entity keeps no state of its own in a table. Command handlers check a command against the current state and append events; event sourcing handlers, which may only assign fields, apply those events. Because the same handlers run again whenever the entity is loaded from its events, any business logic in them would run again on every load. Axon Framework 5 replaced the fixed aggregate stream with a Dynamic Consistency Boundary: events carry tags, one event can belong to several entities, and a consistency marker makes an append fail if matching events were written after the state was read.

Axoniq also sells Axon Server, an event store and message router for commands, events and queries. Since Axon Framework 5.1, connecting to Axon Server, a PostgreSQL-optimised event store and durable workflows that replace the old sagas are commercial Axoniq Framework modules; the open-source core stores events per entity through JPA.

Why teams pick it

  • The open-source core is Apache 2.0 and free in production, covering messaging, entity modelling, event sourcing and test fixtures
  • Commands, events and queries are messages, so components can be split into separate services later without rewriting their callers
  • Dynamic Consistency Boundaries let one command decide over events from several entities, with conflicting writes still detected
  • Fits Spring Boot: annotate an entity with @EventSourced and auto-configuration registers it

Watch out for

  • JVM only
  • Much of what production systems need is in paid Axoniq Framework modules: Axon Server connectivity, PostgreSQL-optimised storage, sequenced dead-letter queues and workflows
  • Axoniq Framework modules check their subscription at runtime: without credentials they run for 15 minutes, and without a connection to Axoniq Platform for 24 hours, before shutting the application down
  • Version 5 is a large break from 4: sagas are gone and aggregates become entities, so upgrades follow a migration guide
  • The open-source core defines only the snapshot storage API; you write the implementation or buy the Axoniq one

Alternatives

What all event sourcing have in common →

How it fits with other technologies

An event-sourced entity (Axon Framework 5) · java

import org.axonframework.eventsourcing.annotation.EventSourcedEntity;
import org.axonframework.eventsourcing.annotation.EventSourcingHandler;
import org.axonframework.eventsourcing.annotation.EventTag;
import org.axonframework.eventsourcing.annotation.reflection.EntityCreator;
import org.axonframework.messaging.commandhandling.annotation.CommandHandler;
import org.axonframework.messaging.eventhandling.gateway.EventAppender;
import org.axonframework.modelling.annotation.TargetEntityId;

record CreateCourseCommand(String courseId, String title, int capacity) {}
record EnrollStudentCommand(@TargetEntityId String courseId, String studentId) {}  // which course to load
record CourseCreatedEvent(@EventTag String courseId, String title, int capacity) {}
record StudentEnrolledEvent(@EventTag String courseId, String studentId) {}

@EventSourcedEntity(tagKey = "courseId")
public class CourseEntity {
    private String courseId;
    private int capacity;
    private int enrolledCount;

    @CommandHandler
    public static String handle(CreateCourseCommand cmd, EventAppender events) {
        if (cmd.capacity() <= 0) throw new IllegalArgumentException("Capacity must be positive");
        events.append(new CourseCreatedEvent(cmd.courseId(), cmd.title(), cmd.capacity()));
        return cmd.courseId();
    }

    @CommandHandler  // runs on the state rebuilt from this course's events
    public void handle(EnrollStudentCommand cmd, EventAppender events) {
        if (enrolledCount >= capacity) throw new IllegalStateException("Course is full");
        events.append(new StudentEnrolledEvent(courseId, cmd.studentId()));
    }

    @EventSourcingHandler  // only assigns state: it runs again on every replay
    private void on(CourseCreatedEvent e) { courseId = e.courseId(); capacity = e.capacity(); }

    @EventSourcingHandler
    private void on(StudentEnrolledEvent e) { enrolledCount++; }

    @EntityCreator
    protected CourseEntity() {}
}

See it in a real stack

No architecture uses Axon Framework yet. Drop it into the playground and wire it up yourself.Open playground →
Where it came from2009–2026

Allard Buijze, a software architect who specialised in scalability, started Axon Framework as open source in 2009. Recurring performance and flexibility problems had convinced him that applications needed a solid domain model, and Axon put the ideas of domain-driven design, CQRS and event sourcing into building blocks for Java.

In July 2017 Buijze and Jeroen Speekenbrink founded AxonIQ (now written Axoniq) to work only on Axon. That year it released AxonHub, a message router that knew the difference between commands, events and queries, and early in 2018 AxonDB, a purpose-built event store. At the 2018 Event-Driven Microservices Conference, where Buijze said the framework had passed one million downloads, the two were merged into Axon Server, offered as open source and as an enterprise version.

Axon Framework 5.0, released in November 2025, replaced the aggregate-centred event store with Dynamic Consistency Boundaries. From 5.1 in 2026, the project split in two: Axon Framework stays Apache 2.0, and Axoniq Framework adds commercial modules such as Axon Server connectivity and workflows.

Why it’s built this way

Location transparency through messages
Buijze argued that the primary feature of Axon is not CQRS but that components don’t know where each other run, so a well-structured monolith can later be split into services without rewriting it.
Events as the source of truth, with handlers kept apart
An entity is rebuilt by replaying its events, so the code that applies events may only assign state, and all decisions live in command handlers that append new events.
Dynamic Consistency Boundaries instead of one stream per aggregate
Tags let an event belong to several entities and let a command read all the events it needs, while a consistency marker still rejects an append if a conflicting event arrived in between.
An open-source core with paid modules
The Apache 2.0 core covers messaging, modelling and event sourcing; production-grade storage, distribution and workflows are sold by subscription as Axoniq Framework.

Timeline

  1. 2009

    Allard Buijze starts Axon Framework as open source

  2. 2017

    AxonIQ is founded in July and releases AxonHub

  3. 2018

    AxonHub and the AxonDB event store merge into Axon Server

  4. 2025

    Axon Framework 5.0 introduces Dynamic Consistency Boundaries

  5. 2026

    5.1 adds the commercial Axoniq Framework modules on top of the open-source core

Sources8 · facts checked 8 October 2026

Improve this page on GitHub