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
Distributed Events
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Stijn Volders
May 12, 2016
Technology
0
45
Distributed Events
Slides of the presentation I gave at the NCrafts conference in Paris on 12 May (
www.ncrafts.io
)
Stijn Volders
May 12, 2016
Tweet
Share
More Decks by Stijn Volders
See All by Stijn Volders
DDD Basics - Context Mapping
one75
1
360
Introduction to RavenDB
one75
1
140
Other Decks in Technology
See All in Technology
Claude_CodeでSEOを最適化する_AI_Ops_Community_Vol.2__マーケティングx_AIはここまで進化した.pdf
riku_423
2
420
データの整合性を保ちたいだけなんだ
shoheimitani
7
2.9k
GitLab Duo Agent Platform × AGENTS.md で実現するSpec-Driven Development / GitLab Duo Agent Platform × AGENTS.md
n11sh1
0
120
日本の85%が使う公共SaaSは、どう育ったのか
taketakekaho
1
140
Introduction to Sansan, inc / Sansan Global Development Center, Inc.
sansan33
PRO
0
3k
MySQLのJSON機能の活用術
ikomachi226
0
150
広告の効果検証を題材にした因果推論の精度検証について
zozotech
PRO
0
100
Introduction to Bill One Development Engineer
sansan33
PRO
0
360
We Built for Predictability; The Workloads Didn’t Care
stahnma
0
130
30万人の同時アクセスに耐えたい!新サービスの盤石なリリースを支える負荷試験 / SRE Kaigi 2026
genda
1
250
Databricks Free Edition講座 データサイエンス編
taka_aki
0
290
なぜ今、コスト最適化(倹約)が必要なのか? ~AWSでのコスト最適化の進め方「目的編」~
htan
1
110
Featured
See All Featured
New Earth Scene 8
popppiees
1
1.5k
How to build an LLM SEO readiness audit: a practical framework
nmsamuel
1
640
The Curious Case for Waylosing
cassininazir
0
230
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
11
820
Deep Space Network (abreviated)
tonyrice
0
45
The Anti-SEO Checklist Checklist. Pubcon Cyber Week
ryanjones
0
55
HU Berlin: Industrial-Strength Natural Language Processing with spaCy and Prodigy
inesmontani
PRO
0
200
SEO in 2025: How to Prepare for the Future of Search
ipullrank
3
3.3k
[RailsConf 2023] Rails as a piece of cake
palkan
59
6.3k
Paper Plane (Part 1)
katiecoart
PRO
0
4k
GitHub's CSS Performance
jonrohan
1032
470k
Paper Plane
katiecoart
PRO
0
46k
Transcript
Stijn Volders Freelance .net consultant Loves complex problems (that can
be solved with software) @one75 https://www.linkedin.com/in/stijnvolders
[email protected]
Distributed Events A case study from the trenches
Agenda • ReTiBo • The “Green List” concept • Synchronization
with events • Scaling with HTTP • Questions
Problem space
Problem space
Problem space
Problem space
Problem space ReTiBo (Registration, Ticketing, Board computer) • User registration
• Travel information (trip duration, available connections,...) • Traffic jams, deviations,...
Problem space 4500 driver consoles
Problem space 12000 validators
Green List
Problem space Synchronization
Problem space over 3G
Problem space
Solution
Solution • Inspired by ATOM • Based on immutable events
• ASP.NET Web API • nginx
Solution • No power = no connection • During (school)
holidays: 5 to 20% not in use
Solution
Synchronisation GET api/streams/greenlist/current now past Green separator: event Black separator:
page
Synchronisation { “links”: [ { “uri”: “api/streams/greenlist/current”, “Rel”: “self” },
{ “uri”: “api/streams/greenlist/2015/4/14?page=2”, “Rel”: “previous” } ], “items”: [{...},{...}], }
Synchronisation GET api/streams/greenlist/2015/4/14?page=2 now past
Synchronisation GET api/streams/greenlist/2015/4/14?page=1 now past
Synchronisation GET api/streams/greenlist/2015/4/13?page=9 now past Colored box: already in local
datastore
Synchronisation past now
Synchronisation past now
Synchronisation Why backwards?
Synchronisation when([SomePatternMatch], function(state, event) { return new state; }); (http://docs.geteventstore.com/introduction/event-sourcing-basics/)
Scaling
Scaling
Scaling Archived events • Cache-Control: max-age=31363200 (somewhere near a year)
Scaling Current window • Cache-Control: max-age=3000
Scaling
Scaling Given • Nothing is cached • A 5 minute
interval • 16500 devices
Scaling 198 000 connections / hour 198 000 database hits
/ hour
Scaling
Scaling Given • A 5 minute cache • A 5
minute interval • 16500 devices
Scaling 6 connections 6 database hits
Scaling 33 000 times less...
Scaling
Scaling
Bandwith 3G, remember?
Bandwidth HTTP to the rescue (again) • ETags • Cache
validation • Conditional requests
Bandwidth
Bandwidth Number time… • 600kb payload for a page of
1000 items • 16h of activity (6am - 10pm) • Sync every 5 minutes
Bandwidth Number time… • 7.2 mb every hour (per device)
• 110 mb after 16 hours (per device) • 1.8 TB for all devices each day
Bandwidth
Bandwidth Number time… (conditional requests) • Most greenlist events are
created by night (batch) • 1 request in the morning = almost always updated (HTTP 200 OK) • 1 update per hour
Bandwidth Number time… (conditional requests) • 600 kb every hour
(per device) • ~10 mb after 16 hours (per device) • 165 GB for all devices each day
Measure!
Wrapping it up • Expose immutable events • Start at
the end and follow “previous” • Replay the events chronologically • Conditional requests
Questions? @one75 https://www.linkedin.com/in/stijnvolders
[email protected]
Thank you! @one75 https://www.linkedin.com/in/stijnvolders
[email protected]