As Grails developers we reflexively lean on the default pattern for data storage: a single row represents the current state of a Domain Object. For most applications, only ever knowing the current state is just fine. However, understanding the manipulations that got your data to that state are just as important as the current state itself, especially in a large system with multiple users.
Enter Event Sourcing: instead of persisting the current state of our Domain Objects, we store historical events about our data. In this talk I will discuss the basic concepts of Event Sourcing. We will discuss the advantages – particularly around performance and analytics – and disadvantages of using this pattern. We will see how easily it can be implemented in Groovy and used within a Grails application. Finally, we’ll examine some practical use cases and when one would consider implementation.
Additionally, there's a code demo that is not covered in the slides, but can be found here: