Domain Events and Event Sourcing go hand in hand? Not Exactly!

  Рет қаралды 11,404

CodeOpinion

CodeOpinion

Күн бұрын

Пікірлер: 20
@delu
@delu 2 жыл бұрын
Would you make a video about how to synchronize microservices data when you add a new microservice to an already existing system?
@CodeOpinion
@CodeOpinion 2 жыл бұрын
Yes, good topic.
@essamal-mansouri2689
@essamal-mansouri2689 Жыл бұрын
It is funny to me that you picked up a level and a screwdriver to shake for the camera while you were talking :D Great video
@CodeOpinion
@CodeOpinion Жыл бұрын
I randomly had them at my desk because I was putting up a picture/frame in the same room the day prior.
@Mvision123
@Mvision123 2 жыл бұрын
I think this video could cause more confusion than it clears up. My understanding was that Aggregates raise 'domain events', and those are persisted in my event store when saving the aggregates, and loaded when I'd perform another operation on that aggregate. They also double as a way to notify other parts of the software in the same boundary.
@CodeOpinion
@CodeOpinion 2 жыл бұрын
"they also double" is exactly the point I'm making. They don't. They have different purposes.
@Mvision123
@Mvision123 2 жыл бұрын
So I rewatched it and I'm still confused implementation wise. What if performing an action on an aggregate raises both a domain event and an 'event representing stare change ' exactly the same data? Do you introduce two types and map between those?
@nitrovent
@nitrovent 2 жыл бұрын
@@Mvision123 I would introduce two events. Alone for versioning purposes that should make it easier to change the implementation of the event sourcing and keep compatibility with the outside. Imagine you wrap the event sourcing part for persistence in let's say a repository that loads the aggregates. Then when thinking about domain events you wouldn't look into the implementation detail of that persistence.
@slacquer2007
@slacquer2007 Жыл бұрын
I have always looked at it this way (to prevent confusion), a Domain event is an APPLICATION DOMAIN EVENT, IE, and event in that executables process space. All other events for DDD DOMAIN consumption are referred to as Integration events. This has helped the teams that I have been part of over the last several years in clarity. Just my 2 cents. Nice video though. Thanx.
@antoniokovacevic627
@antoniokovacevic627 2 жыл бұрын
In your example at 4:45 you show how domain events are used for workflows. What about projections? Do you use event sourced events or domain events to build projections? What if the projection happens outside the boundary? Using your example, if I wanted to show order status on the UI, what are my options?
@CodeOpinion
@CodeOpinion 2 жыл бұрын
Projections within your own boundary would use the events from the event stream. From outside your boundary, you're using integration (or domain) events. Your question is more leaning towards view/ui composition: kzbin.info/www/bejne/f33Fm36IZquLpcU
@zeamessaoud
@zeamessaoud 2 жыл бұрын
Can you make a video about event sourcing and long lived entity when we can't keep streams short? Thank you!
@CodeOpinion
@CodeOpinion 2 жыл бұрын
I touch on it in this video: kzbin.info/www/bejne/iYrWmnyuf5KBnNk
@zeamessaoud
@zeamessaoud 2 жыл бұрын
@@CodeOpinion than you 👍
@zxcmask1023
@zxcmask1023 2 жыл бұрын
So if specific event is important for both event sourcing and communication e.g ProductAddedToCart, would you use 1 or 2 events for that? And I guess mechanism of dispatching domain event vs ES event could differ
@CodeOpinion
@CodeOpinion 2 жыл бұрын
Exactly.
@thedacian123
@thedacian123 2 жыл бұрын
So each aggregate/entity has an event stream,Is not it?Thanks!
@CodeOpinion
@CodeOpinion 2 жыл бұрын
Yes, each instance of an aggregate has its own event stream.
@basilthomas790
@basilthomas790 2 жыл бұрын
Domain Events and Event Sourcing do NOT go hand in hand but clearly Domain Events play a key role in all parts of event driven architecture. Event Sourcing is really a technical implementation detail mainly concerning recreating current state of an aggregate from a event log of ordered immutable events when processing an aggregate command. Event sourcing can be very complicated to implement and really should be defined by the needs of your business model first before making it a part of your general architecture. I think you would be better off explaining bounded contexts and aggregates for each bounded context and aggregate state changes via domain events before discussing advanced concepts like Event Sourcing which can come off as more confusing without a good understanding of Domain Driven Design. Excellent overall discussion though.
@CodeOpinion
@CodeOpinion 2 жыл бұрын
I have a bunch of videos on these topics, specifically boundaries (bounded contexts) and different ways of designing aggregates.
Event Sourcing in 1 Hour with Marten in .NET
1:13:42
CodeOpinion
Рет қаралды 19 М.
Domain-Driven Design: The Last Explanation You'll Ever Need
21:05
Software Developer Diaries
Рет қаралды 11 М.
Players push long pins through a cardboard box attempting to pop the balloon!
00:31
А я думаю что за звук такой знакомый? 😂😂😂
00:15
Денис Кукояка
Рет қаралды 5 МЛН
Quando A Diferença De Altura É Muito Grande 😲😂
00:12
Mari Maria
Рет қаралды 15 МЛН
Deadpool family by Tsuriki Show
00:12
Tsuriki Show
Рет қаралды 3,7 МЛН
Don't Let the Internet Dupe You, that's NOT Event Sourcing
13:14
CodeOpinion
Рет қаралды 10 М.
Microservices with Databases can be challenging...
20:52
Software Developer Diaries
Рет қаралды 100 М.
You DON'T want an In-Memory Event Bus like MediatR
11:20
CodeOpinion
Рет қаралды 23 М.
Event Sourcing • Martin Fowler • YOW! 2016
28:06
GOTO Conferences
Рет қаралды 26 М.
Event Sourcing: Rehydrating Aggregates with Snapshots
14:54
CodeOpinion
Рет қаралды 19 М.
Wix.com -  5 Event Driven Architecture Pitfalls!
13:36
CodeOpinion
Рет қаралды 12 М.
Players push long pins through a cardboard box attempting to pop the balloon!
00:31