Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
CQRS & Event Sourcing in OLX
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Łukasz Szymański
May 16, 2016
Programming
2k
7
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
CQRS & Event Sourcing in OLX
Łukasz Szymański
May 16, 2016
More Decks by Łukasz Szymański
See All by Łukasz Szymański
Chain reaction of scaling up
szymanskilukasz
1
180
GraphQL Without Hype
szymanskilukasz
0
320
PHP's Not Dead - PHP7 In Practice
szymanskilukasz
10
43k
Text Retrieval
szymanskilukasz
0
230
OLX pod maską [PL]
szymanskilukasz
2
750
Other Decks in Programming
See All in Programming
クラウドエージェントは、 何がそんなに便利なのか / what makes cloud agents so useful
rkaga
5
670
AI時代のシニアエンジニアとは
yosuke_furukawa
PRO
14
11k
ChromeでローカルLLM
ryu1013
0
190
React Native에 현대적인 빌드 도구 더하기: Rollipop 구현기
leegeunhyeok
0
180
Engineering Biometric UX Across Android Versions | DroidKnights 2026
ryunen344
0
120
最近”作らせてる” ローカルAIアプリの話
akit37
0
530
GraphQL の onError と Nullability のこれから
quramy
0
200
高橋メソッドでCVE解説シリーズ 〜CVE-2026-112816〜
hakkadaikon
0
170
[Dev Group Paris Octobre 26] Agentforce, SIforce, Claudeforce, Slackbot… on s'y retrouve ?
nabondance
0
130
Modernizing iOS Apps
seyfoyun
0
140
flutter_test のその先へ — Flutter アプリの LLM 機能に「評価」という品質保証を
kosukesaigusa
0
170
HTML-in-Canvasで作る未来のWeb UI表現
clockmaker
5
6.1k
Featured
See All Featured
HDC tutorial
michielstock
2
990
Ten Tips & Tricks for a 🌱 transition
stuffmc
1
280
Avoiding the “Bad Training, Faster” Trap in the Age of AI
tmiket
0
290
Money Talks: Using Revenue to Get Sh*t Done
nikkihalliwell
0
540
How to audit for AI Accessibility on your Front & Back End
davetheseo
0
620
[Rails World 2026] Durable orchestration on Rails: from continuation to workflow
palkan
2
990
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
31
3.4k
Code Reviewing Like a Champion
maltzj
529
40k
Skip the Path - Find Your Career Trail
mkilby
1
280
DBのスキルで生き残る技術 - AI時代におけるテーブル設計の勘所
soudai
PRO
68
59k
Max Prin - Stacking Signals: How International SEO Comes Together (And Falls Apart)
techseoconnect
PRO
0
520
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
360
31k
Transcript
CQRS Event Sourcing in OLX
CQRS
you can use a different model to update information than
the model you use to read information http://martinfowler.com/bliki/CQRS.html „
Command Query Responsibility Segregation
Command Query Responsibility Segregation
new AddCredits($userId, $amount); Command
Command new AddCredits($userId, $amount); Query new GetCredits($userId);
Event Sourcing
http://www.martinfowler.com/eaaDev/EventSourcing.html „ ensures that all changes to application state are
stored as a sequence of events
Not just can we query these events, we can also
use the event log to reconstruct past states http://www.martinfowler.com/eaaDev/EventSourcing.html „
Commad Event Model Event Storage Event Bus Command Handler Listeners
Read Storage Read Model Query
Commad Event Model Event Storage Event Bus Command Handler Listeners
Read Storage Read Model Query Critical section - use transaction
Commad Event Model Event Storage Event Bus Command Handler Listeners
Read Storage Read Model Query Critical section - use transaction Treat like temporary cache
That’s all
E-Wallet Credits; Invoices; Refunds
Wallet Credits Bonus Credits Refund Credits EXPIRE: X DAYS EXPIRE:
X DAYS EXPIRE: X DAYS INVOICE: YES/NO INVOICE: YES/NO INVOICE: YES/NO
Wallet Credits Bonus Credits Refund Credits EXPIRE: NEVER EXPIRE: 90
DAYS EXPIRE: 90 DAYS INVOICE: YES INVOICE: NO INVOICE: YES
Opis walleta w Polsce specyfikacja komenty enventy Commands
Add Wallet Credits Add Bonus Credits Add Refund Credits
Sub Wallet Credits Sub Bonus Credits Sub Refund Credits SubCredits
Opis walleta w Polsce specyfikacja komenty enventy Events
Wallet CreditsWasAdded Bonus CreditsWasAdded Refund CreditsWasAdded
Wallet CreditsWasSubtracted Bonus CreditsWasSubtracted Refund CreditsWasSubtracted
specyfikacja komenty enventy 7 commands 6 events
specyfikacja komenty enventy What about other stuff?
Commad Event Model Event Storage Event Bus Command Handler Listeners
Read Storage Read Model Query ?
Broadway komponenty Broadway https://github.com/qandidate-labs/broadway
Auditing log whether commands were successful or not
CommandHandling Provides the interface and a CommandHandler base class for
handling events
Domain domain abstractions of the Broadway framework including the aggregate
root, domain messages and domain events.
EventDispatcher The component provides an event dispatcher interface and a
simple implementation
EventHandling provides interfaces for an event bus and event listeners,
but also an implementation of a simple event bus and an event bus that will record published events
EventSourcing Provides base classes for event sourced aggregate roots and
entities, an event sourced repository implementation and testing helpers.
EventStore implementation based on doctrine/dbal to store events in a
relational database and an in-memory implementation that is useful for using in tests
ReadModel provides storage for your read models, a projector implementation
to create read models from event streams and testing helpers.
Repository Component providing an abstraction of the storage of aggregates.
Serializers provides a simple serializer interface and a serializer implementation
based on "handwritten" serializers
Commad Event Model Event Storage Event Bus Command Handler Listeners
Read Storage Read Model Query Broadway
Adding Wallet Credits
None
None
Credits Query
None
None
Lessons Learned
Small Steps Don’t try to CQRS/EventSource everything
Keep It Simple Avoid names like BonusCreditsWasSubtractedBecauseAdminHitSubtractBonusCr editsInAdminPanelEvent
Event Storming is not that easy as it sounds
It’s not RDBM Remember about analysts
Code changes Events handle changes to data, what about changes
to code?
Synchronize Remember about synchronizing read layer - especially after fail
Commad Event Model Event Storage Event Bus Command Handler Listeners
Read Storage Read Model Query Critical section - use transaction
Performance is not an issue - for this case
Timezone Agnostic Implement your own EventStore if you want timezone
aware records
Our Team
Paid Features
Next challenge Open source Paid Features libraries with Hexagonal Architecture
in mind
Team Lead PHP Dev Junior PHP Dev You ?
Łukasz Szymański Development Team Lead at @szymanskilukasz http://szymanskilukasz.github.io/ https://www.linkedin.com/in/szymanskilukasz https://twitter.com/szymanskilukasz