event sourcing in practice lessons learned. · event sourcing in practice lessons learned. mikael...
TRANSCRIPT
![Page 1: Event sourcing in practice lessons learned. · Event sourcing in practice lessons learned. Mikael Sundberg @msundb. Event sourcing? Store events instead of current state. Testing](https://reader034.vdocument.in/reader034/viewer/2022042321/5f0bad147e708231d431abb9/html5/thumbnails/1.jpg)
Event sourcing in practice lessons learned.
Mikael Sundberg @msundb
![Page 2: Event sourcing in practice lessons learned. · Event sourcing in practice lessons learned. Mikael Sundberg @msundb. Event sourcing? Store events instead of current state. Testing](https://reader034.vdocument.in/reader034/viewer/2022042321/5f0bad147e708231d431abb9/html5/thumbnails/2.jpg)
Event sourcing?
Store events instead of current state
![Page 3: Event sourcing in practice lessons learned. · Event sourcing in practice lessons learned. Mikael Sundberg @msundb. Event sourcing? Store events instead of current state. Testing](https://reader034.vdocument.in/reader034/viewer/2022042321/5f0bad147e708231d431abb9/html5/thumbnails/3.jpg)
Testing
![Page 4: Event sourcing in practice lessons learned. · Event sourcing in practice lessons learned. Mikael Sundberg @msundb. Event sourcing? Store events instead of current state. Testing](https://reader034.vdocument.in/reader034/viewer/2022042321/5f0bad147e708231d431abb9/html5/thumbnails/4.jpg)
Testing
Old events need to work
Write raw events to database
![Page 5: Event sourcing in practice lessons learned. · Event sourcing in practice lessons learned. Mikael Sundberg @msundb. Event sourcing? Store events instead of current state. Testing](https://reader034.vdocument.in/reader034/viewer/2022042321/5f0bad147e708231d431abb9/html5/thumbnails/5.jpg)
MonitoringUsed to monitor what went wrong
![Page 6: Event sourcing in practice lessons learned. · Event sourcing in practice lessons learned. Mikael Sundberg @msundb. Event sourcing? Store events instead of current state. Testing](https://reader034.vdocument.in/reader034/viewer/2022042321/5f0bad147e708231d431abb9/html5/thumbnails/6.jpg)
MonitoringHow do you know that something that should have happened didn't happen?
![Page 7: Event sourcing in practice lessons learned. · Event sourcing in practice lessons learned. Mikael Sundberg @msundb. Event sourcing? Store events instead of current state. Testing](https://reader034.vdocument.in/reader034/viewer/2022042321/5f0bad147e708231d431abb9/html5/thumbnails/7.jpg)
![Page 8: Event sourcing in practice lessons learned. · Event sourcing in practice lessons learned. Mikael Sundberg @msundb. Event sourcing? Store events instead of current state. Testing](https://reader034.vdocument.in/reader034/viewer/2022042321/5f0bad147e708231d431abb9/html5/thumbnails/8.jpg)
MonitoringBreadcrumbs!
![Page 9: Event sourcing in practice lessons learned. · Event sourcing in practice lessons learned. Mikael Sundberg @msundb. Event sourcing? Store events instead of current state. Testing](https://reader034.vdocument.in/reader034/viewer/2022042321/5f0bad147e708231d431abb9/html5/thumbnails/9.jpg)
![Page 10: Event sourcing in practice lessons learned. · Event sourcing in practice lessons learned. Mikael Sundberg @msundb. Event sourcing? Store events instead of current state. Testing](https://reader034.vdocument.in/reader034/viewer/2022042321/5f0bad147e708231d431abb9/html5/thumbnails/10.jpg)
![Page 11: Event sourcing in practice lessons learned. · Event sourcing in practice lessons learned. Mikael Sundberg @msundb. Event sourcing? Store events instead of current state. Testing](https://reader034.vdocument.in/reader034/viewer/2022042321/5f0bad147e708231d431abb9/html5/thumbnails/11.jpg)
![Page 12: Event sourcing in practice lessons learned. · Event sourcing in practice lessons learned. Mikael Sundberg @msundb. Event sourcing? Store events instead of current state. Testing](https://reader034.vdocument.in/reader034/viewer/2022042321/5f0bad147e708231d431abb9/html5/thumbnails/12.jpg)
Protect your domainYou are not a message bus
![Page 13: Event sourcing in practice lessons learned. · Event sourcing in practice lessons learned. Mikael Sundberg @msundb. Event sourcing? Store events instead of current state. Testing](https://reader034.vdocument.in/reader034/viewer/2022042321/5f0bad147e708231d431abb9/html5/thumbnails/13.jpg)
![Page 14: Event sourcing in practice lessons learned. · Event sourcing in practice lessons learned. Mikael Sundberg @msundb. Event sourcing? Store events instead of current state. Testing](https://reader034.vdocument.in/reader034/viewer/2022042321/5f0bad147e708231d431abb9/html5/thumbnails/14.jpg)
![Page 15: Event sourcing in practice lessons learned. · Event sourcing in practice lessons learned. Mikael Sundberg @msundb. Event sourcing? Store events instead of current state. Testing](https://reader034.vdocument.in/reader034/viewer/2022042321/5f0bad147e708231d431abb9/html5/thumbnails/15.jpg)
![Page 16: Event sourcing in practice lessons learned. · Event sourcing in practice lessons learned. Mikael Sundberg @msundb. Event sourcing? Store events instead of current state. Testing](https://reader034.vdocument.in/reader034/viewer/2022042321/5f0bad147e708231d431abb9/html5/thumbnails/16.jpg)
![Page 17: Event sourcing in practice lessons learned. · Event sourcing in practice lessons learned. Mikael Sundberg @msundb. Event sourcing? Store events instead of current state. Testing](https://reader034.vdocument.in/reader034/viewer/2022042321/5f0bad147e708231d431abb9/html5/thumbnails/17.jpg)
Protect your domainDon't let your domain become fat.
![Page 18: Event sourcing in practice lessons learned. · Event sourcing in practice lessons learned. Mikael Sundberg @msundb. Event sourcing? Store events instead of current state. Testing](https://reader034.vdocument.in/reader034/viewer/2022042321/5f0bad147e708231d431abb9/html5/thumbnails/18.jpg)
Event schema● Avro● Protobuff
![Page 19: Event sourcing in practice lessons learned. · Event sourcing in practice lessons learned. Mikael Sundberg @msundb. Event sourcing? Store events instead of current state. Testing](https://reader034.vdocument.in/reader034/viewer/2022042321/5f0bad147e708231d431abb9/html5/thumbnails/19.jpg)
Ordering of events
Some messages are faster than others
![Page 20: Event sourcing in practice lessons learned. · Event sourcing in practice lessons learned. Mikael Sundberg @msundb. Event sourcing? Store events instead of current state. Testing](https://reader034.vdocument.in/reader034/viewer/2022042321/5f0bad147e708231d431abb9/html5/thumbnails/20.jpg)
![Page 21: Event sourcing in practice lessons learned. · Event sourcing in practice lessons learned. Mikael Sundberg @msundb. Event sourcing? Store events instead of current state. Testing](https://reader034.vdocument.in/reader034/viewer/2022042321/5f0bad147e708231d431abb9/html5/thumbnails/21.jpg)
![Page 22: Event sourcing in practice lessons learned. · Event sourcing in practice lessons learned. Mikael Sundberg @msundb. Event sourcing? Store events instead of current state. Testing](https://reader034.vdocument.in/reader034/viewer/2022042321/5f0bad147e708231d431abb9/html5/thumbnails/22.jpg)
![Page 23: Event sourcing in practice lessons learned. · Event sourcing in practice lessons learned. Mikael Sundberg @msundb. Event sourcing? Store events instead of current state. Testing](https://reader034.vdocument.in/reader034/viewer/2022042321/5f0bad147e708231d431abb9/html5/thumbnails/23.jpg)
![Page 24: Event sourcing in practice lessons learned. · Event sourcing in practice lessons learned. Mikael Sundberg @msundb. Event sourcing? Store events instead of current state. Testing](https://reader034.vdocument.in/reader034/viewer/2022042321/5f0bad147e708231d431abb9/html5/thumbnails/24.jpg)
![Page 25: Event sourcing in practice lessons learned. · Event sourcing in practice lessons learned. Mikael Sundberg @msundb. Event sourcing? Store events instead of current state. Testing](https://reader034.vdocument.in/reader034/viewer/2022042321/5f0bad147e708231d431abb9/html5/thumbnails/25.jpg)
Ordering of events
Network can cause messages to lose order
![Page 26: Event sourcing in practice lessons learned. · Event sourcing in practice lessons learned. Mikael Sundberg @msundb. Event sourcing? Store events instead of current state. Testing](https://reader034.vdocument.in/reader034/viewer/2022042321/5f0bad147e708231d431abb9/html5/thumbnails/26.jpg)
![Page 27: Event sourcing in practice lessons learned. · Event sourcing in practice lessons learned. Mikael Sundberg @msundb. Event sourcing? Store events instead of current state. Testing](https://reader034.vdocument.in/reader034/viewer/2022042321/5f0bad147e708231d431abb9/html5/thumbnails/27.jpg)
![Page 28: Event sourcing in practice lessons learned. · Event sourcing in practice lessons learned. Mikael Sundberg @msundb. Event sourcing? Store events instead of current state. Testing](https://reader034.vdocument.in/reader034/viewer/2022042321/5f0bad147e708231d431abb9/html5/thumbnails/28.jpg)
![Page 29: Event sourcing in practice lessons learned. · Event sourcing in practice lessons learned. Mikael Sundberg @msundb. Event sourcing? Store events instead of current state. Testing](https://reader034.vdocument.in/reader034/viewer/2022042321/5f0bad147e708231d431abb9/html5/thumbnails/29.jpg)
![Page 30: Event sourcing in practice lessons learned. · Event sourcing in practice lessons learned. Mikael Sundberg @msundb. Event sourcing? Store events instead of current state. Testing](https://reader034.vdocument.in/reader034/viewer/2022042321/5f0bad147e708231d431abb9/html5/thumbnails/30.jpg)
![Page 31: Event sourcing in practice lessons learned. · Event sourcing in practice lessons learned. Mikael Sundberg @msundb. Event sourcing? Store events instead of current state. Testing](https://reader034.vdocument.in/reader034/viewer/2022042321/5f0bad147e708231d431abb9/html5/thumbnails/31.jpg)
Events are in order!
![Page 32: Event sourcing in practice lessons learned. · Event sourcing in practice lessons learned. Mikael Sundberg @msundb. Event sourcing? Store events instead of current state. Testing](https://reader034.vdocument.in/reader034/viewer/2022042321/5f0bad147e708231d431abb9/html5/thumbnails/32.jpg)
The good
● Your queries are always fast● Replicating immutable data is easy● You can’t query the data easily● Encourages good domain models● Nothing is ever deleted
![Page 33: Event sourcing in practice lessons learned. · Event sourcing in practice lessons learned. Mikael Sundberg @msundb. Event sourcing? Store events instead of current state. Testing](https://reader034.vdocument.in/reader034/viewer/2022042321/5f0bad147e708231d431abb9/html5/thumbnails/33.jpg)
Imageshttps://www.flickr.com/photos/eltpics/13664102064https://www.flickr.com/photos/54257797@N07/5210582753https://commons.wikimedia.org/wiki/File:Mocking_Bird_Argument.jpghttps://commons.wikimedia.org/wiki/File:Pigeon_silhouette_4874.svghttp://www.publicdomainpictures.net/view-image.php?image=147003&picture=sad-face-ostrichhttps://upload.wikimedia.org/wikipedia/commons/0/09/Sitta-carolinensis-001.jpghttps://www.flickr.com/photos/alancleaver/4204419570https://upload.wikimedia.org/wikipedia/commons/5/50/Gall-dindi.jpghttp://maxpixel.freegreatpicture.com/White-Stream-Winter-Snow-Swans-Nature-Bird-1323089http://maxpixel.freegreatpicture.com/Bird-Breadcrumbs-Wrought-Iron-652575https://upload.wikimedia.org/wikipedia/commons/thumb/b/b4/BirdBeaksA.svg/465px-BirdBeaksA.svg.pnghttps://www.flickr.com/photos/kumarsedit/15481104857https://www.flickr.com/photos/malingering/8129080389https://commons.wikimedia.org/wiki/File:Birds.jpghttps://upload.wikimedia.org/wikipedia/commons/7/71/Cacatua_moluccensis_excited.jpg