You probably do not need event sourcing
Event sourcing is an expensive default. Temporal resources and signals let us model history and reactions without making the whole application depend on replay.
I think event sourcing is a terrible default for business applications.
The pitch is attractive. Keep everything that happened, derive the state you need, and rebuild it whenever your requirements change. You get history, flexibility and a story about how your application will scale. Then somebody asks whether two users can register with the same email address, and you find yourself designing a reservation workflow.
I would quite like to get back to building the application.
There are places where keeping an authoritative sequence of events makes sense. If the events themselves are essential business data, and interpreting that sequence is what the application does, event sourcing can be a reasonable choice. But a requirement to retain analytics events or application logs doesn't, by itself, require event sourcing. Storing events and deriving your application's authoritative state from them are different commitments.
That distinction matters. An application can publish events, run background jobs and retain history without making every user, subscription and permission a projection of an event stream.
Email uniqueness should be boring
Imagine that each user has an event stream. Before registering someone, you check a read model to see whether their email address is available. Two requests arrive together. Both see that it is. Both append a registration event to their own stream.
Optimistic concurrency on either stream doesn't help. Neither stream has a competing write. The invariant spans both of them.
You can solve this. You might reserve the email first, introduce a shared consistency boundary, or use a relational table with a unique constraint. But now you have to decide how registration interacts with the reservation, what happens when one step fails, and whether an abandoned reservation expires.
This is sufficiently common that Golo Roden, one of the people behind EventSourcingDB, has written an article comparing six approaches to email uniqueness. It covers solutions from a single aggregate through reservations to borrowing a SQL unique index. These are workable designs. They also represent work you must justify doing.
In a relational database, with an appropriately normalised email and a unique constraint, competing inserts into that table cannot both succeed. If your event store and uniqueness table share a transaction, you can use that guarantee too. The expensive part is choosing independently committed boundaries and then discovering that your business rules cross them. Sharding a relational system across independent databases can create the same problem.
My objection is to paying that price before the application gives us a reason.
Your old schemas remain your problem
Once historical events are part of your source of truth, your ability to interpret them becomes part of your persistence contract.
You don't have to keep every old command handler. You don't have to predict every event the business might ever invent. You do need a strategy for reading the representations you've already stored for as long as you expect to replay them.
Microsoft's event-sourcing guidance describes tolerant readers, versioned events, upcasters and in-place migrations. An upcaster translates an older event into the representation your current code understands. That can keep the rest of your application cleaner, but the translation still needs to exist, work and be tested.
Suppose an old registration event contains a display name and the new model expects separate given and family names. No amount of replay can reliably recover information you never collected. A relational migration has the same limitation. Keeping every event doesn't exempt you from deciding what missing information means.
The schema-evolution problem has even been the subject of research into event-store upgrade strategies. There are solutions. Adopting the architecture means adopting responsibility for one of them.
Rebuild it from ten billion events
“Just rebuild the projection” sounds pleasantly disposable. Let's put some numbers beside it.
Suppose a new read model needs to process ten billion events. At a sustained 100,000 events per second, that takes about 27.8 hours. At a million per second, it still takes about 2.8 hours.
These are arithmetic examples, not benchmarks. They assume the stated throughput includes decoding, translating and applying events, and that no new events arrive while you work. A live system needs enough spare processing capacity to catch up with incoming traffic as well.
Snapshots can make rebuilding an individual aggregate much cheaper. They don't necessarily contain the detail required for a new historical read model. The EventSourcingDB team's replay guidance explicitly distinguishes those cases, and discusses filtering, checkpoints, parallel processing and protecting production workloads.
You also need a cutover plan. Will readers see an incomplete projection while it rebuilds? Will you build another copy alongside the live one and switch over when it catches up? Oskar Dudycz describes how that works in Emmett, including the coordination needed to make rebuilding reliable.
And replaying internal state must stay separate from sending emails, charging cards or calling other systems. Fowler discusses the complications of external effects and historical external data in his original description of event sourcing.
None of this makes rebuilding impossible. It makes rebuilding an operational capability that somebody has to build and maintain. I want to see that capability costed before “we can always replay it” becomes an architectural selling point.
Scale does not make this inevitable
Large organisations have published quite detailed accounts of scaling relational applications.
In 2021, GitHub described partitioning the MySQL tables behind users, repositories, issues and pull requests. Those tables were serving an average of 1.2 million queries per second across their clusters, predominantly reads, while average load per host had halved following their partitioning work.
That same year, Shopify described its Core database infrastructure: hundreds of MySQL shards, partitioned by shop, each with a writer and at least five replicas. The database VM fleet numbered in the thousands.
Those reports don't tell us that neither company uses event sourcing anywhere. They tell us that important, complicated application workloads have a credible relational path to substantial scale. They also describe real engineering effort. Relational databases aren't magic either.
Growth gives you problems to solve. It doesn't dictate that your source of truth must become a log of domain events.
Model facts over time
A lot of what people want from event sourcing is the ability to ask what was true at some earlier point. I think we should model that requirement directly.
A subscription's plan is a fact with a period of validity. It might be bronze from January until March and gold from March onwards. Those periods are useful data in their own right.
Ash's temporal resources represent records this way. Actions accept an as_of option, defaulting to now, which travels through the shared context into related reads and nested actions. Assuming a temporal subscription resource, a historical read looks like this:
Ash.get!(MyApp.Subscription, subscription_id,
actor: actor,
tenant: tenant,
as_of: ~U[2026-01-15 00:00:00Z]
)
You query the fact valid at that instant. You don't need to reconstruct it by running a sequence of domain events.
Move through time. Read the matching fact.
as_of: ~U[2026-01-15 00:00:00Z]The Ash team isn't in the habit of shipping unfinished features. Here, “experimental” means the API may still evolve.
Using temporal features with AshPostgres requires PostgreSQL 18+ and btree_gist. AshPostgres generates the period-aware keys and constraints.
An identity can enforce email uniqueness at every instant while allowing reuse in non-overlapping periods.
Valid-time history isn't a complete audit trail: backdated corrections can change it, and actor, intent and recording history may need separate tracking. Nor does as_of reload the supplied actor's attributes historically; authorisation needs a deliberate policy.
Temporal tables still need storage, indexes and migrations. Their attraction is how directly they express this particular requirement.
Let resources react through signals
The other common requirement is that a change in one part of the application should cause work somewhere else. An order is placed, so loyalty points should be awarded.
Ash signals give those interactions an explicit, typed contract. An action declares what it emits; resources declare which signals they listen for and which actions handle them. The producer doesn't need to enumerate its consumers.
Signals can run before an action, after it, or after its transaction. Default delivery is inline: within a transaction, listener failure can roll back the emitter. After commit, it cannot. Delivery extensions can schedule work instead. This decouples resource definitions while leaving transaction and delivery choices visible.
The testing helpers let you assert what a producer emits and exercise a consumer without running the producer's workflow. For example, given a signal contract and a loyalty listener, this delivers directly to that resource:
Ash.Signals.Test.react_to_signal(
MyApp.Shop.Signals,
:order_placed,
%{order_id: order_id, customer_id: customer.id},
only: MyApp.Loyalty.Account,
inline?: true
)
You still set up records that the listener needs. You can avoid constructing the entire checkout just to test awarding points. Producer assertions don't automatically suppress listeners, so that side may still need integration setup.
Deliver work durably with AshOban
AshOban.Signals moves a listener into a persisted Oban job. For example, a receipt listener can choose its queue and attempt limit:
signals_in do
from MyApp.Shop.Signals do
on :order_placed, :send_receipt,
delivery: {AshOban.Signals, queue: :mailers, max_attempts: 10}
end
end
Configure the queue in Oban, emit during :after_action, and use the same repo for Oban and the emitting resource. The job then commits with the order, and the listener runs afterwards. A rollback removes both. That closes the gap between saving an order and remembering to enqueue its receipt. If the repos differ, that atomic guarantee doesn't apply. Configure an actor persister when the listener needs the originating actor.
Failures can be retried, but durable delivery doesn't mean an external effect happens exactly once or eventually succeeds regardless of failure. Make repeated attempts safe, and monitor jobs that exhaust their attempts. Oban documents retry and discard behaviour.
We can also model when work becomes eligible. An AshOban trigger can select records whose cooldown has elapsed, using a stored timestamp, or snooze work when an external service needs breathing room. For retry strategies, triggers support fixed or function-based backoff, as well as the default exponential strategy. Those trigger options are separate from the signal delivery options above.
Persisted signals still need compatibility across deployments. AshOban supports upgrading queued payloads; once no queued job retains the old shape, that upgrader can be removed. We have a compatibility obligation for outstanding work, without committing to replaying the application's entire history. The signal migration guide explains the lifecycle.
Model workflows that take time
Some processes take days and involve people. An application might validate a request automatically, wait for approval, remind the reviewer and eventually escalate it. A background job alone doesn't describe that process particularly well.
AshWorkflow wires together ash_state_machine states and transitions, ash_oban triggers for automatic work, and Ash actions for manual transitions. Its DSL also expresses deadlines and recurring reminders. A review step might look like this inside a workflow:
step :awaiting_review do
transition :approve, to: :approved
transition :reject, to: :rejected
timeout :reminder, fire_after: {2, :days}, action: :send_review_reminder
timeout :escalation, fire_after: {7, :days}, transition_to: :escalated_review
end
The surrounding resource supplies the destination steps and reminder action. Deadlines are checked by the scheduler, so the polling interval affects when they run.
A human can invoke the approval action through an interface. An agent could invoke that same action through an authorised tool: that's an application integration using the generated action, with the same need for appropriate policies. The workflow can remain waiting until either acts or a deadline takes it elsewhere.
Waiting is a state, too.
Now we have durable background work, explicit state transitions and time-dependent behaviour. We can inspect where a request is waiting without reconstructing it from a lifetime of events. That is a much closer fit to the business process I wanted to describe.
Keep event sourcing where it earns its place
An analytics subsystem may need the original sequence of observations to calculate new results. An event log may be valuable precisely because it retains what happened. Keep those events. If a particular subsystem needs to derive its authoritative state from them, event sourcing deserves consideration there.
That decision can stay local. It doesn't require the rest of the application to adopt the same persistence model.
There is also a real difference between knowing that a subscription had a particular plan and knowing the sequence of business decisions that produced it. Temporal facts and transient signals won't recover intent you never stored. If authoritative replay of those decisions is a product requirement, say so and budget for it.
But history, reactions and anticipated growth are not enough on their own. We have ways to model all three without taking on the compatibility and replay obligations of an event-sourced application.
Use event sourcing when you can name the capability that earns its cost. “We might get big” isn't that capability.