Database for Event Sourcing

About the tool

Event sourcing is a design pattern used in applications where changes are stored as an immutable sequence of events rather than in a traditional data model. The append-only event log serves as a single source of truth from which the current state of the system can be derived.

By storing the changes as an immutable log of events, you can compute the current state of the system as well as its state at any point in the past. This pattern is useful in applications where you need to keep full track of the history such as in accounting, banking, and e-commerce applications.

I've created this tool to help you understand the pattern and design your own event-sourced applications. You can use it to create a simulated event log and run a view that aggregates the events using a reducer function written in JavaScript. You can run your view at any specific point in time or the latest point.

Good luck with your event-sourced applications!


A JavaScript function that takes two arguments: state and event. state is an object that represents the current state of the view. event is an object that represents the event that is being processed. The function must return the next state of the view.
Run as at
Press Run to see the result.

Made by Anton Vasetenkov.

If you want to say hi, you can reach me on LinkedIn or via email. If you like my work, you can support me by buying me a coffee.