"Every microservice get's its own database and then use Kafka" is a typical and naive advise, when reading about eventsourcing. If you approach this architectural style this way, you will probably have a really awful time ahead.
Eventsourcing and CQRS are two very useful and popular patterns when dealing with data and microservices. We often find in our customer's projects, that both have a severe impact on your future options and the maintainability of your architecture. Presentations and articles on both topics are often superficial and do not tackle real world problems like security and compliance requirements.
This combination of half-knowledge and technical confusion leads to many projects that either refactor back to a 'non-eventsourced' architecture or reduce eventsourcing to a message queue.
In this talk, I will summarize our experience while applying eventsourcing and CQRS accros multiple large financial and insurance companies over the last 5 years. We will cover the Good, the Not so Good, and the 'oh my god...all abandon ships!' when doing eventsourcing in the real world...and see how we solved these issues.
3. @koenighotze
Eventsourcing - You are maybe doing parts
of it wrong because we made some mistakes
along the way and so will you, I guess. This
is difficult because there are no easy right/
wrong answers; only trade-offs.
28. @koenighotze#Devoxx #EventSourcingFTW
User Aggregate
userId: 9714de5c…
email: foo@bar.de
address: <new address>
Represents
the user at
the time of
the last
event read
Current User Projection
handle User
Created
handle User
Onboarded
handle User
Relocated
…
61. @koenighotze#Devoxx #EventSourcingFTW
“Only withdraw money, if the bank
account holds enough money!”*
*Actually, a real bank would not want such a business
rule. They earn money if you overdraw your account. An
overdraft fee is one of the most expensive fees banks
charge. Just saying…
133. @koenighotze#Devoxx #EventSourcingFTW
Year end – also known as an accounting reference
date – is the completion of an accounting period.
At this time, businesses need to carry out specific
procedures to close their books.
https://debitoor.com/dictionary/year-end
186. @koenighotze#Devoxx #EventSourcingFTW
Recital 26
EU GDPR
(26) The principles of data protection should apply to any information
concerning an identified or identifiable natural person.
Personal data which have undergone pseudonymisation, which could
be attributed to a natural person by the use of additional information
should be considered to be information on an identifiable natural
person.
187. @koenighotze#Devoxx #EventSourcingFTW
Recital 26
EU GDPR
(26) The principles of data protection should apply to any information
concerning an identified or identifiable natural person.
Personal data which have undergone pseudonymisation, which could
be attributed to a natural person by the use of additional information
should be considered to be information on an identifiable natural
person.
191. @koenighotze#Devoxx #EventSourcingFTW
ES + DDD =
Needs more up-front design
You can refactor, you can clean up
Not enough in-depth books
Avoid frameworks esp. if going polyglot
Beware: “just…” or “…made easy”