From the course: Software Architecture: Patterns for Developers
Unlock this course with a free trial
Join today to access over 24,700 courses taught by industry experts.
Event sourcing
From the course: Software Architecture: Patterns for Developers
Event sourcing
- [Instructor] In this video, we'll dive into event sourcing. In event sourcing, instead of storing the current state of our data in the database, we store the events that happened to our data. An event is defined as something that occurred in the past. If you want to know what the current state is of a certain entity, you apply all previous events to a new object. This is called rehydration or event replay. An example can clarify things. Traditionally, we retrieve a record from our database, for example, a customer with the name Amina, then we update the name to Sophia and store that value in the database. There's no trace of the original name. In event sourcing, we could see two events, a first one indicating a customer with the name Amina was created, and the second indicating the name was changed. To get the latest version of our customer, we replay these events and end up with an object representing our customer named Sophia. A great advantage of event sourcing is the trace you…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
(Locked)
Layered3m 39s
-
(Locked)
Onion3m 12s
-
(Locked)
Ports and adapters (or hexagonal)2m 32s
-
(Locked)
Differences between layered, onion, and hexagonal2m 25s
-
(Locked)
Modular monolith4m 37s
-
(Locked)
Microkernel3m 12s
-
(Locked)
CQRS4m 39s
-
(Locked)
Event sourcing5m 24s
-
Combining CQRS and event sourcing3m 36s
-
(Locked)
-
-