This talk is about staying sane when using eventsouring in your microservices.
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 across 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.
* Introduction to eventsourcing and CQRS - which problems does ES solve, why do we need it
* Your eventstore is not a message queue - why mixing both up is bad for you
* No, Kafka is not an eventsource - choosing the right tool
* Read models are overrated - why you should not start with readmodels
* GDPR, compliance and eventsourcing - what happens if you delete data from an immutable structure
* Transactions, concurrency and your eventsource - why serial writers are bad and how to handle consistency
* Versions, up-front-design and breaking things down the road - how to evolve eventsourced architectures
3. @koenighotze
Eventsourcing - You are maybe
doing 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.
6. @koenighotze
Are YOU building microservices?
Are YOU doing Domain Driven Design?
Are YOU applying eventsourcing?
Are YOU using Kafka as an eventstore?
21. @koenighotze
Eventsourcing helps answering the question
of dealing with data in distributed systems in
a scalable way.
It makes the dynamics of your systems
explicit as first class concepts
48. @koenighotze
Most event handlers are neither CPU
or IO intensive
Prefer small aggregates, if it makes
sense in your domain
Measure and introduce persistent
read models only if needed
51. @koenighotze
“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…
62. @koenighotze
Quick tip for finding friends in ops:
Ask them to “just” install and maintain
production ready Kafka and
Couchbase installations in the Cloud
147. @koenighotze
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
170. @koenighotze
Consumers must mostly be forward and
backward compatible
Beware lossy events
Prefer projections to event data copying
Refer across aggregates using root ids
197. @koenighotze
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.
198. @koenighotze
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.
202. @koenighotze
ES + DDD =
Needs more up-front design
You can refactor, you can clean up
Not enough in-depth books
Avoid frameworks
Beware: “just…” or “…made easy”