Event sourcing is an architectural pattern that takes advantage of immutability for storage. The fundamental idea of event sourcing is the following—instead of storing the current state of data, how about we store the events that modify the data? This idea may seem radical, but it's not new; in fact, you're already using tools based on this principle—source-control systems such as Git follow this architecture. We will explore this idea in more detail, including a discussion about its advantages and disadvantages.
The following topics will be covered in this chapter:
- How the concept of immutability can be applied to data storage
- What event sourcing architecture looks like
- What to take into account when deciding whether to use event sourcing