Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Event Sourcing RubySPBConf 2k18
Search
Anton Davydov
June 10, 2018
Programming
1
210
Event Sourcing RubySPBConf 2k18
Anton Davydov
June 10, 2018
Tweet
Share
More Decks by Anton Davydov
See All by Anton Davydov
How to make a technical decision
davydovanton
0
120
МГТУ
davydovanton
0
76
Events. Events. Events! - krk.rb
davydovanton
0
150
Events. Events. Events!
davydovanton
0
820
Architecture of hanami applications
davydovanton
1
7.7k
Hanami Architecture
davydovanton
2
310
viewing ruby blossom kaigi2017
davydovanton
0
740
viewing ruby blossom rdrc2017
davydovanton
2
230
rodauth device and you
davydovanton
2
250
Other Decks in Programming
See All in Programming
AI時代の認知負荷との向き合い方
optfit
0
160
Oxlint JS plugins
kazupon
1
980
AtCoder Conference 2025
shindannin
0
1.1k
並行開発のためのコードレビュー
miyukiw
0
320
高速開発のためのコード整理術
sutetotanuki
1
410
QAフローを最適化し、品質水準を満たしながらリリースまでの期間を最短化する #RSGT2026
shibayu36
2
4.4k
MUSUBIXとは
nahisaho
0
140
[KNOTS 2026登壇資料]AIで拡張‧交差する プロダクト開発のプロセス および携わるメンバーの役割
hisatake
0
290
AgentCoreとHuman in the Loop
har1101
5
240
Raku Raku Notion 20260128
hareyakayuruyaka
0
340
CSC307 Lecture 07
javiergs
PRO
1
560
コントリビューターによるDenoのすゝめ / Deno Recommendations by a Contributor
petamoriken
0
210
Featured
See All Featured
Code Reviewing Like a Champion
maltzj
527
40k
技術選定の審美眼(2025年版) / Understanding the Spiral of Technologies 2025 edition
twada
PRO
117
110k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
49
9.9k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
1.7k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.4k
Believing is Seeing
oripsolob
1
56
[SF Ruby Conf 2025] Rails X
palkan
1
760
The agentic SEO stack - context over prompts
schlessera
0
640
My Coaching Mixtape
mlcsv
0
48
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
141
34k
Why Your Marketing Sucks and What You Can Do About It - Sophie Logan
marketingsoph
0
76
Pawsitive SEO: Lessons from My Dog (and Many Mistakes) on Thriving as a Consultant in the Age of AI
davidcarrasco
0
67
Transcript
->
[email protected]
title: SPBRuby2k18
None
None
None
None
@palkan_tula
me
What I learned in Japan?
Ruby is still dying language
None
Java is popular
None
Pascal is popular too
None
Best shell ever
None
❤ Руддщ ЫЗИ! ❤
❤ Hello SPB! ❤
None
None
None
Anton Davydov github.com/davydovanton twitter.com/anton_davydov davydovanton.com
• Software developer at Hippo • Hanami core developer •
OpenSource evangelist
None
Stickers
None
Part 1: Real World
DEMO
Part 2: Software
None
None
None
None
None
Pros • easy for understand • easy for implement
Cons • we have only current state of the system
• impossible to understand what happened before
Sometimes we need more work for one event
Imagine what will happen if we will work only with
events?
None
None
None
None
None
Congrats, you know event sourcing!
Part 3: Event Sourcing
– Event Sourcing pattern https://docs.microsoft.com/en-us/azure/architecture/patterns/event-sourcing “Instead of storing just the
current state of the data in a domain, use an append-only store to record the full series of actions taken on that data”
How to get business events?
Event Storming
DDD
Part 4: Event Store
None
None
Can be anything
None
Rules
Immutable events
Immutable everything
How to store events?
None
None
None
None
None
How get current state?
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
How we can improve it?
None
None
None
None
None
None
None
Part 5: Conclusions
Event Sourcing pros
Easier to communicate with domain experts
• time traveling • restore a system • logging out
from box
• You don’t work with tables you work with events
• Experemental data structures • Easy to change database implementations
• Easy to add instances for service • Can be
written on any language and you can call it from any app • Persistance
event sourcing cons
• Hard for understand and complicated abstraction • Not popular
in ruby and bad tooling here • Developers need deprogramming
• Hard to get state • Hard to understand the
whole chain of events • Another architecture type with different DB structure
• Async world • Versions and versions compatibility • Updating
or deleting events • Eventual Consistency
Part 6: Usage
Simple way
gems
None
github.com/zilverline/sequent
Brave way
Build all stuff by self
None
None
None
hanami-events
Just pub sub transport layer with event versions and types
microservices
microservices
None
How to share state across DBs?
Idea #1: send data to specific service
None
Problems
One service know about data from other
1 -> N
None
None
Idea #2: events
None
None
None
Important
Make events full as you can
None
None
None
Part 7: Next Steps
CQRS (Command Query Responsibility Segregation)
– Martin Fowler “You can use a different model to
update information than the model you use to read information”
None
None
None
None
None
None
DDD
None
None
None
Books
None
->
[email protected]
title: SPBRuby2k18
github.com/davydovanton twitter.com/anton_davydov davydovanton.com Thank you ❤