§Learn

Learn the model. Then build.

Start with the problem Ekbatan solves, then learn the core model, write an Action, consume persisted events, add sharding, and look at native-image. When you are ready to wire a real application, the complete setup guide keeps the detailed project setup in one place.

01

Getting started

Start here. Follow one wallet change through the dual-write problem, Model events, Action staging, executor commit, and post-commit consumption.

02

The dual-write trap

Why writing to a database and to Kafka separately creates silent drift, and why the event must be stored with the state first.

03

The outbox: atomic state + events

How Ekbatan commits domain rows and event rows together, so the database contains both the state and the fact that changed it.

04

Models and Entities

Models emit events when they change; Entities don't. Learn which shape to use and how immutable mutations work.

05

Actions, ActionPlan, ActionExecutor

The two-phase lifecycle: build the new state first, then let the executor commit domain rows and event rows in one transaction.

06

Your first Action

Build a wallet deposit Action end-to-end: define the Model, attach an Event, wire the Action, run it through an ActionExecutor.

07

Consuming events

Use persisted events after commit: handle them in the same service, publish from a handler, stream with CDC, or route one raw stream into many broker topics.

08

Adding a shard

Take a single-database service to two shards using EmbeddedBitsShardingStrategy. Your action signatures don't change.

09

Sharding strategies

The deeper model behind groups, members, embedded-bits IDs, custom routing, and why cross-shard actions need care.

10

Sagas

Split multi-step workflows into committed actions chained by events, with explicit compensation when a later step fails.

11

Compiling to a native binary

Add the ekbatan-native dependency, declare your scan packages, include migration resources, and run the native build/test path for your stack.

12

Complete project setup

The full stack/build/database setup matrix: scaffold, dependencies, Flyway migrations, jOOQ codegen, DB config, startup migrator, examples, and verification.