Eric Elliott
2 min readMay 18, 2017

--

The command pattern, event sourcing, and Redux are all different architectures, but they all accomplish a similar goal: transactional state management.

Event sourcing is not the same architecture as Redux any more than the command pattern is.

However, what these architectures have in common is more important than what makes them different. Transactional state is the essence, and that has existed since at least the 1960’s and the invention of transactional databases.

What is revolutionary about Redux architecture is how it standardized the process of managing transactional state with reducers.

In that sense, it applies the idea of transactional state to a particular context and demonstrates how reducer functions over action objects (events) can be the single source of truth for the application state.

Event sourcing never did anything of the sort. It does not prescribe how events are handled, only their creation and recording.

Typical event sourcing implementations were a mix of object-oriented and imperative code. Event objects were commonly applied with polymorphic methods, and seaparately persisted with object serializers. Side effects were common.

By encoding the action type in the message, and keeping the action object itself completely unaware of the objects on which it acts and methods being called, Redux action objects serialize easier. Reducers generalize easier.

By handling action objects with pure reducers, Redux guarantees that all relevant application state gets reproduced when we replay the log in a way that event sourcing never did. OO programs using event sourcing were typically littered with all manner of side-effects, intentionally or otherwise.

Redux can be compared to event sourcing at a high level, and you could generalize the idea of event sourcing to encompass Redux, but to say that Redux is event sourcing is a stretch. It’s like event sourcing in the same way that it’s like the command pattern and like append-only database systems.

There is nothing new under the sun, but also, you can never step twice into the same river.

--

--