Event Sourcing: Rehydrating Aggregates with Snapshots

Event Sourcing: Rehydrating Aggregates with Snapshots

But to combat this, you can leverage snapshots to give you a representation of your aggregates state at a point in time. You can then use this as a checkpoint and them only replay the events since the snapshot.

Once you understand how Event Sourcing works, the most common thought is: "What happens when you have a lot of Events? Won't it be inefficient to fetch every event from the EventStore and replay all of them to get to current state?". It might be. But to combat this, you can leverage snapshots to give you a representation of your aggregates state at a point in time. You can then use this as a checkpoint and them only replay the events since the snapshot.

📝 Blog: https://codeopinion.com/snapshots-in-event-sourcing-for-rehydrating-aggregates/

🔔 Subscribe: https://www.youtube.com/channel/UC3RKA4vunFAfrfxiJhPEplw?sub_confirmation=1

💥 Join this channel to get access to source code, demos, and slides! https://www.youtube.com/channel/UC3RKA4vunFAfrfxiJhPEplw/join

📝 Blog: https://codeopinion.com

📚 Book Recommendations

Domain-Driven Design https://amzn.to/2QwG8sb

Patterns of Enterprise Application Architecture https://amzn.to/3d8kMJj

Refactoring: Improving the Design of Existing Code https://amzn.to/2NVdP5Q

Monolith to Microservices: Evolutionary Patterns to Transform Your Monolith https://amzn.to/3srUuZ6

RESTful Web Clients: Enabling Reuse Through Hypermedia https://amzn.to/3d8Q96B

0:00 Intro 2:24 Snapshots 5:19 Code Implementation 5:39 Aggregate 7:05 Repository 9:31 Creating a Snapshot 10:18 Demo

CodeOpinon: https://codeopinion.com Twitter: https://twitter.com/codeopinion

#eventsourcing #cqrs #softwarearchitecture

eventsourcing cqrs softwarearchitecture

What is Geek Coin

What is GeekCash, Geek Token

Best Visual Studio Code Themes of 2021

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Is a REST API with CQRS Possible?

If you're developing a HTTP API (what most would call REST) how does that fit along side a Task-Based UI and CQRS? How can you create a REST API with CQRS? For starters, resources don't need to map to Entities. Second, HTTP Methods don't need to map to CRUD.

CQRS Myths | 3 Most Common Misconceptions

Here are the 3 most common myths I constantly see about CQRS when it's explained in blog posts or videos. This video explains exactly what CQRS is, as well as what it is not.

Is CQRS Complicated? No, it's simple!

It's often referenced alongside other patterns that can make it seem difficult and complicated. Is CQRS complicated? No. CQRS is simple.

.Net Core CQRS + MediatR | CQRS Pattern | Mediator Pattern

.Net Core CQRS + MediatR | CQRS Pattern | Mediator Pattern. CQRS ve Mediator Pattern'i anlatarak küçük bir örnek yaptığımız bu videoda, bu kalıpların neden ve nasıl kullanıldıklarına dair açıklamalara yaparak bir proje geliştirdik. Mediator pattern'ini uygulayabilmek için ise MediatR isimli kütüphaneyi kullandık.

Event Sourcing Example & Explained in plain English

What is Event Sourcing? It's a way of storing data that is probably very different than what you're used to. I'll explain the differences and show event sourcing example that should clear up all the mystery around it.