This demo showcases an event-sourcing implementation using a fictional story about capybaras. The purpose is to illustrate how event sourcing can be used to track changes over time in a system. We`re going to highlight the main features such as:
- Complete history of changes;
- Audit and compliance;
- Scalability and performance;
- Replay and debugging;
- Flexibility;
- Integration with reactive systems;
Cléo writes everything in a diary: who arrived, who left, and who brought food. Each note is an event recorded with date and time. If someone asks how the party was 3 months ago, Cléo can recount everything in minute detail.
One day, the chief capybara wants to know who ate all the carrots. Cléo reviews the records and identifies the culprits (it was Capybara Carlos!). No fights, just facts.
CapybaraVille grows, and Cléo starts recording events in several notebooks organized by sectors. Other capybaras help with the process, noting events in parallel and synchronizing everything at the end of the day.
During the fruit fair, a problem occurs: the stock disappears! Cléo opens the records and replays the events to find out what went wrong. It was a counting error in the "Watermelon Delivery" event.
The village decides to start recording the quantity of fruits, something that wasn't done before. Cléo doesn't alter the old records—she just adds future events with this new information.
Now the village wants automatic alerts when an important event happens—like the arrival of a carrot truck. Cléo adds a bell that rings whenever she notes something relevant.
To run the application, follow these steps:
dotnet build
dotnet run --project CapybaraVille.AppHost
This is an .NET Aspire application. You will need: