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
Handling Scale with Reactive Programming
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Alex Xandra Albert Sim
September 29, 2018
Technology
120
0
Share
Handling Scale with Reactive Programming
Summary of reactive programming concept and basics
Alex Xandra Albert Sim
September 29, 2018
More Decks by Alex Xandra Albert Sim
See All by Alex Xandra Albert Sim
System Operations
bertzzie
0
82
The Future of Working in IT
bertzzie
1
98
Dependency Injection in Spring
bertzzie
0
87
Scala: Lessons Learned from the Battlefield
bertzzie
0
81
Lessons We Learned Through Hell When Scaling Blibli.com
bertzzie
0
240
Introduction to GraalVM
bertzzie
0
170
Building Fintech App in Java: Tips & Trick
bertzzie
0
170
Scaling Software Architecture: 101 and Best Practices
bertzzie
0
230
Spring Cloud Contract Introduction
bertzzie
0
650
Other Decks in Technology
See All in Technology
Platform Engineering as a Product: Criteria for Improvement and Multi-Tenant Design
kumorn5s
0
380
Oracle AI Database@AWS:サービス概要のご紹介
oracle4engineer
PRO
4
2.7k
Gradle×GitHub_ActionsでCI時間を約50%短縮 ジョブ分割の設計と落とし穴 / Cutting CI Time by ~50% with Gradle and GitHub Actions: Job-Splitting Design and Pitfalls
takatty
0
530
Agentic AI時代における メルカリのAIガバナンスとガードレール実装
naoichihara
16
17k
シンデレラなんかになりたくない!ガラスの靴が割れた時代にどう歩く?
nomizone
0
220
AI時代から振り返るTerraform drift運用の歴史 / AI Age Reflections on the History of Terraform Drift Operations
aeonpeople
0
590
Platform engineering for developers, architects & the rest of us (AI agents)
danielbryantuk
0
150
「使われるデータ基盤」を目指してデータアナリストとワークショップをやった話
jackojacko_
2
930
Javaで学ぶSOLID原則
negima
1
240
GitHub Copilot のこれまでとこれから: From Copilot to Collaborative Agents
yuriemori
1
230
Datadog 認定試験の概要と対策
uechishingo
0
190
A Harness for Behaviour: how to get AI to generate code that does what we intend, or "TDD in the age of AI"
xpmatteo
1
520
Featured
See All Featured
Pawsitive SEO: Lessons from My Dog (and Many Mistakes) on Thriving as a Consultant in the Age of AI
davidcarrasco
0
150
Exploring anti-patterns in Rails
aemeredith
3
380
Paper Plane
katiecoart
PRO
1
50k
Done Done
chrislema
186
16k
A better future with KSS
kneath
240
18k
VelocityConf: Rendering Performance Case Studies
addyosmani
333
25k
30 Presentation Tips
portentint
PRO
1
310
Mozcon NYC 2025: Stop Losing SEO Traffic
samtorres
1
240
Paper Plane (Part 1)
katiecoart
PRO
0
8k
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.7k
Marketing to machines
jonoalderson
1
5.3k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
Transcript
Handling Scale with Reactive Programming Alex Xandra Albert Sim
Disclaimer Presentations are intended for educational purposes only and not
to replace independent professional judgment. The views and opinions expressed in this presentation do not necessarily reflect the official policy or position of blibli.com. Audience discretion is advised.
Who am I? • Alex Xandra Albert Sim • Principal
Research and Development Engineer at blibli.com •
[email protected]
• bertzzie(.sim)
Reactive Manifesto
Reactive Manifesto A good reactive systems are: • Responsive •
Resilient • Elastic • Message Driven
Reactive Manifesto A good reactive systems are: • Responsive •
Resilient • Elastic • Message Driven
Reactive Manifesto A good reactive systems are: • Responsive •
Resilient • Elastic • Message Driven
Reactive Manifesto A good reactive systems are: • Responsive •
Resilient • Elastic • Message Driven
Reactive Manifesto A good reactive systems are: • Responsive •
Resilient • Elastic • Message Driven
ACHIEVING RESPONSIVENESS
The Classic Web Architecture
The Classic Web Architecture
The Normal Flow Users Internet Web app (tomcat, netty, php,
etc) Application process
What’s in “application process”?
Classical Code Sample
Classical Code Sample
Potensi Bottleneck
Little’s Law ! = # × % L : Jumlah
koneksi ke database λ : Load dari request W : Waktu respons database
Little’s Law (Contoh) Untuk kasus di mana: • Terdapat 500
request / detik • Database memberikan response dalam 30ms • Jumlah koneksi db yang diperlukan adalah 15 L = λ x W L = 500 rps x 0.03s L = 15
Alur Kehancuran Sistem (1)
Solusi? • Naikkan jumlah pool / queue? • NO, karena
hanya membantu di average case • Kenapa? • DB down 1 menit, 500 rps tetap masuk
Solusi 1
Solusi 2
Solusi Queue • Membuat sistem konsisten. • Misal: 3 queue
berarti sistem akan memberikan respon max 120ms • Average menurun, tapi lebih stabil • Belum hitung cache! • + cache rate 50%, average bisa < 50ms
Queue dan Timeout • Timeout == batas sistem dianggap gagal
• Request tidak selalu terdistribusi rapi • Average tidak sepenting Max Response Time
ON PARALLELISM
Sequential Execution Start a b c Result Latency
Parallel Execution Latency Start a b c Result
Composable Future
Keterbatasan Parallelisme
Keterbatasan Parallelisme
What we miss L • Resilience: Compartmentalization • Resilience: Circuit
Breaker • Resilience: Supervision pattern • Message passing • Actor system • BASE Pattern
Maybe next time!
QUESTION AND ANSWERS
Come with us. We have cookies.
Thank You