A couple of days back, someone asked me if I have worked with CQRS and ES. And honestly, I had no idea what that person was talking about. I quickly got in front of my laptop and started my quest of learning about these things.

CQRS stands for Command Query Responsibility Segregation. It is a programming principle that was originally introduced by Bertrand Meyer during his work on the Eiffel programming language.

In simple terms, CQRS states that everything in our code should either be a command that performs some action, or a query that that returns some data to the caller. CQRS provides a clear separation of concerns. The command can only change the application state and the query can only get the state to the user.

ES here stands for Event Sourcing. In event sourcing, the changes made to the state are stored as a sequence of events, where each event describes a change made to the application state.

Both ES and CQRS are most often grouped together. By applying event sourcing above CQRS, we can easily persist each event on the command side of the application. The query side of the app can then be easily derived from the sequence of events.

After getting a basic understanding of what Event Sourcing and Command Query Resposibility Segregation are, I set out to look for something that could help me easily build applications using these interesting principles.

That is when I came across reSolve!

reSolve is an awesome new framework for building apps based on CQRS and ES.

In this post, I will show you how to get started with building applications with reSolve.

You can get the entire source code of this post here:

Tip: Use Bit to share and reuse React components. Create a collection you and your team can share, and use the components to build new apps faster. Try it.