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
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
Sansan Engineering Unit 紹介資料
sansan33
PRO
1
3.8k
MCPでつなぐElasticsearchとLLM - 深夜の障害対応を楽にしたい / Bridging Elasticsearch and LLMs with MCP
sashimimochi
0
140
What happened to RubyGems and what can we learn?
mikemcquaid
0
240
データの整合性を保ちたいだけなんだ
shoheimitani
8
2.9k
We Built for Predictability; The Workloads Didn’t Care
stahnma
0
130
GitHub Issue Templates + Coding Agentで簡単みんなでIaC/Easy IaC for Everyone with GitHub Issue Templates + Coding Agent
aeonpeople
1
170
【5分でわかる】セーフィー エンジニア向け会社紹介
safie_recruit
0
42k
Bill One急成長の舞台裏 開発組織が直面した失敗と教訓
sansantech
PRO
1
290
2026年はチャンキングを極める!
shibuiwilliam
9
1.9k
【インシデント入門】サイバー攻撃を受けた現場って何してるの?
shumei_ito
0
1.5k
あたらしい上流工程の形。 0日導入からはじめるAI駆動PM
kumaiu
5
760
usermode linux without MMU - fosdem2026 kernel devroom
thehajime
0
210
Featured
See All Featured
How to build an LLM SEO readiness audit: a practical framework
nmsamuel
1
640
WCS-LA-2024
lcolladotor
0
440
HDC tutorial
michielstock
1
360
Test your architecture with Archunit
thirion
1
2.1k
Claude Code のすすめ
schroneko
67
210k
The Curse of the Amulet
leimatthew05
1
8.2k
What’s in a name? Adding method to the madness
productmarketing
PRO
24
3.9k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
133
19k
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.6k
4 Signs Your Business is Dying
shpigford
187
22k
How Software Deployment tools have changed in the past 20 years
geshan
0
32k
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
110
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]