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
Bulletproof communication in distributed systems
Search
Jakub Kubryński
March 30, 2019
Programming
0
470
Bulletproof communication in distributed systems
Jakub Kubryński
March 30, 2019
Tweet
Share
More Decks by Jakub Kubryński
See All by Jakub Kubryński
Autonomous deployments in modern distributed systems
jkubrynski
1
110
JVM Workshop
jkubrynski
1
190
Engineering architecture
jkubrynski
0
770
Case study of the good enough architecture
jkubrynski
0
380
JPA - Beyond Copy-Paste
jkubrynski
3
1.5k
Microservices - The Naked Truth Of The Maintainability
jkubrynski
1
670
Other Decks in Programming
See All in Programming
TypeScript Graph でコードレビューの心理的障壁を乗り越える
ysk8hori
2
1.1k
카카오페이는 어떻게 수천만 결제를 처리할까? 우아한 결제 분산락 노하우
kakao
PRO
0
110
Contemporary Test Cases
maaretp
0
130
AWS IaCの注目アップデート 2024年10月版
konokenj
3
3.3k
受け取る人から提供する人になるということ
little_rubyist
0
230
as(型アサーション)を書く前にできること
marokanatani
9
2.6k
CSC509 Lecture 11
javiergs
PRO
0
180
Laravel や Symfony で手っ取り早く OpenAPI のドキュメントを作成する
azuki
2
110
AI時代におけるSRE、 あるいはエンジニアの生存戦略
pyama86
6
1.1k
役立つログに取り組もう
irof
28
9.6k
OnlineTestConf: Test Automation Friend or Foe
maaretp
0
110
タクシーアプリ『GO』のリアルタイムデータ分析基盤における機械学習サービスの活用
mot_techtalk
4
1.4k
Featured
See All Featured
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
126
18k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
25
1.8k
Fantastic passwords and where to find them - at NoRuKo
philnash
50
2.9k
Raft: Consensus for Rubyists
vanstee
136
6.6k
How To Stay Up To Date on Web Technology
chriscoyier
788
250k
Unsuck your backbone
ammeep
668
57k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
38
1.8k
GitHub's CSS Performance
jonrohan
1030
460k
How to train your dragon (web standard)
notwaldorf
88
5.7k
Side Projects
sachag
452
42k
Agile that works and the tools we love
rasmusluckow
327
21k
Fontdeck: Realign not Redesign
paulrobertlloyd
82
5.2k
Transcript
@jkubrynski / kubrynski.com @jkubrynski / kubrynski.com BULLETPROOF BULLETPROOF COMMUNICATION COMMUNICATION
JAKUB KUBRYNSKI JAKUB KUBRYNSKI
[email protected]
/ @jkubrynski / kubrynski.blog
$ WHOAMI $ WHOAMI DEVSKILLER CO-FOUNDER DEVSKILLER CO-FOUNDER BOTTEGA TRAINER
BOTTEGA TRAINER DEVOXX.PL PROGRAM COMMITTEE MEMBER DEVOXX.PL PROGRAM COMMITTEE MEMBER SPRING CLOUD CONTRACT CO-AUTHOR SPRING CLOUD CONTRACT CO-AUTHOR
DEVSKILLER IS LOOKING FOR DEVSKILLER IS LOOKING FOR HELLO-WORLD DEVELOPERS
HELLO-WORLD DEVELOPERS
WHY DISTRIBUTED SYSTEMS? WHY DISTRIBUTED SYSTEMS? SCALABILITY SCALABILITY POLYGLOT POLYGLOT
RESILIENCE RESILIENCE
DISTRIBUTED SYSTEMS FALLACIES DISTRIBUTED SYSTEMS FALLACIES THE NETWORK IS RELIABLE
THE NETWORK IS RELIABLE LATENCY IS ZERO LATENCY IS ZERO THE NETWORK IS SECURE THE NETWORK IS SECURE TOPOLOGY DOESN'T CHANGE TOPOLOGY DOESN'T CHANGE
IF YOU WON'T RESPECT FALLACIES IF YOU WON'T RESPECT FALLACIES
YOU'LL BUILD DISTRIBUTED MONOLITH YOU'LL BUILD DISTRIBUTED MONOLITH
BRACE YOURSELF BRACE YOURSELF FAILURE IS COMING FAILURE IS COMING
IN MONOLITH ALL COLLABORATORS ARE IN MONOLITH ALL COLLABORATORS ARE
ALWAYS AVAILABLE ALWAYS AVAILABLE
IN DISTRIBUTED SYSTEMS THEY ARE NOT IN DISTRIBUTED SYSTEMS THEY
ARE NOT NETWORK ISSUES NETWORK ISSUES REDEPLOYS REDEPLOYS OUTAGES OUTAGES
AVAILABILITY VS DOWNTIME AVAILABILITY VS DOWNTIME 9 9 . 9
9 9 % 35d 4d 8h 50m 5m per year 2.5h 14m 1.5m 8s 0.8s per day
99.9 (1.5 MIN/DAY) 99.9 (1.5 MIN/DAY) 5 * 99.9 =>
99.5 (7 MIN/DAY) 5 * 99.9 => 99.5 (7 MIN/DAY)
TEMPORAL COUPLING TEMPORAL COUPLING
DESIGN FOR FAILURE DESIGN FOR FAILURE
PREFER ASYNCHRONOUS PREFER ASYNCHRONOUS OVER SYNCHRONOUS OVER SYNCHRONOUS
ASYNCHRONOUS ACTORS ASYNCHRONOUS ACTORS COMMANDS (QUEUES) COMMANDS (QUEUES) EVENTS (TOPICS)
EVENTS (TOPICS)
ASYNCHRONOUS PRINCIPLES ASYNCHRONOUS PRINCIPLES PERSISTENT PERSISTENT AT-LEAST-ONCE DELIVERY AT-LEAST-ONCE DELIVERY
EXPONENTIAL RETRIES EXPONENTIAL RETRIES
SYNCHRONOUS SYNCHRONOUS IS USED ONLY WHEN REQUIRED IS USED ONLY
WHEN REQUIRED
WHAT COULD POSSIBLY GO WRONG? WHAT COULD POSSIBLY GO WRONG?
¯\_(ツ)_/¯ ¯\_(ツ)_/¯
TIMEOUT?!?! TIMEOUT?!?! RETRY RETRY
CIRCUIT BREAKER CIRCUIT BREAKER KEEP CALM AND FALLBACK KEEP CALM
AND FALLBACK
IN MONOLITH TOPOLOGY IS FIXED IN MONOLITH TOPOLOGY IS FIXED
IN DISTRIBUTED SYSTEMS IT'S NOT IN DISTRIBUTED SYSTEMS IT'S NOT
CLOUD NATIVE / CONTAINERS CLOUD NATIVE / CONTAINERS DYNAMIC SCALABILITY DYNAMIC SCALABILITY
ALWAYS USE SERVICE DISCOVERY ALWAYS USE SERVICE DISCOVERY
LOAD BALANCERS SUCKS LOAD BALANCERS SUCKS IT'S SINGLE POINT OF
FAILURE IT'S SINGLE POINT OF FAILURE
ALWAYS USE CLIENT SIDE LOAD BALACING ALWAYS USE CLIENT SIDE
LOAD BALACING
IT'S ALL ABOUT COMMUNICATION IT'S ALL ABOUT COMMUNICATION SO NICE
TO KNOW IT WORKS SO NICE TO KNOW IT WORKS
DISTRIBUTED SYSTEMS DISTRIBUTED SYSTEMS VS VS MICROSERVICES MICROSERVICES
MICROSERVICES BRING MICROSERVICES BRING AUTONOMY AUTONOMY
AUTONOMY IS HARD AUTONOMY IS HARD BECAUSE WE NEED TO
COORDINATE DEPENDENCIES BECAUSE WE NEED TO COORDINATE DEPENDENCIES AND BE BACKWARD COMPATIBLE AND BE BACKWARD COMPATIBLE
LOOSE COUPLING LOOSE COUPLING OVER OVER CANONICAL MODEL CANONICAL MODEL
END-TO-END TESTS ARE HARD END-TO-END TESTS ARE HARD FALSE-NEGATIVE FALSE-NEGATIVE
FALSE-POSITIVE FALSE-POSITIVE
VERIFY CONTRACTS VERIFY CONTRACTS A == C && B ==
C A == C && B == C A == B A == B
CONTRACT CONVERTS TO CONTRACT CONVERTS TO SERVER TEST SERVER TEST
CLIENT STUB CLIENT STUB
PERFORMANCE? PERFORMANCE?
MONITORING IS THE NEW TESTING MONITORING IS THE NEW TESTING
MONITORING MONITORING EXCEPTIONS EXCEPTIONS BUSINESS METRICS BUSINESS METRICS APPLICATION PERFORMANCE
MANAGEMENT APPLICATION PERFORMANCE MANAGEMENT
ANSCOMBE'S QUARTET ANSCOMBE'S QUARTET Mean of x => 9 Sample
variance of x => 11 Mean of y => 7.50 Sample variance of y => 4.125 Correlation => 0.816 Linear regression => y = 3.00 + 0.500x
PERCENTILES PERCENTILES P50, P90, P95, P99 P50, P90, P95, P99
MONITOR MONITOR P99.9 OR P99.95 P99.9 OR P99.95
THANKS THANKS
DROGA.DEV DROGA.DEV
QUESTIONS? QUESTIONS?
"Have no fear of perfection - you'll never reach it."
― Salvador Dalí