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
43
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
130
Other Decks in Technology
See All in Technology
いま注目しているデータエンジニアリングの論点
ikkimiyazaki
0
460
GC25 Recap+: Advancing Go Garbage Collection with Green Tea
logica0419
1
210
生成AI活用のベストプラクティス集を作ってる件
asei
1
380
避けられないI/O待ちに対処する: Rails アプリにおけるSSEとasync gemの活用 / Tackling Inevitable I/O Latency in Rails Apps with SSE and the async gem
moznion
2
1.6k
全てGoで作るP2P対戦ゲーム入門
ponyo877
3
1.1k
Goのビルドシステムの変遷 / The history of Go's build system
ymotongpoo
12
3.3k
KAGのLT会 #8 - 東京リージョンでGAしたAmazon Q in QuickSightを使って、報告用の資料を作ってみた
0air
0
170
Flaky Testへの現実解をGoのプロポーザルから考える | Go Conference 2025
upamune
1
200
AI Agentと MCP Serverで実現する iOSアプリの 自動テスト作成の効率化
spiderplus_cb
0
180
OCI Network Firewall 概要
oracle4engineer
PRO
1
7.7k
業務自動化プラットフォーム Google Agentspace に入門してみる #devio2025
maroon1st
0
150
#普通の文系サラリーマンチャレンジ 自分でアプリ開発と電子工作を続けたら人生が変わった
tatsuya1970
0
670
Featured
See All Featured
It's Worth the Effort
3n
187
28k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
667
120k
The Power of CSS Pseudo Elements
geoffreycrofte
78
6k
Art, The Web, and Tiny UX
lynnandtonic
303
21k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
31
2.2k
[RailsConf 2023] Rails as a piece of cake
palkan
57
5.8k
Unsuck your backbone
ammeep
671
58k
KATA
mclloyd
32
14k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
17k
The Illustrated Children's Guide to Kubernetes
chrisshort
48
51k
4 Signs Your Business is Dying
shpigford
185
22k
Imperfection Machines: The Place of Print at Facebook
scottboms
269
13k
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]