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
Alex Xandra Albert Sim
September 29, 2018
Technology
0
110
Handling Scale with Reactive Programming
Summary of reactive programming concept and basics
Alex Xandra Albert Sim
September 29, 2018
Tweet
Share
More Decks by Alex Xandra Albert Sim
See All by Alex Xandra Albert Sim
System Operations
bertzzie
0
46
The Future of Working in IT
bertzzie
1
84
Dependency Injection in Spring
bertzzie
0
69
Scala: Lessons Learned from the Battlefield
bertzzie
0
53
Lessons We Learned Through Hell When Scaling Blibli.com
bertzzie
0
220
Introduction to GraalVM
bertzzie
0
150
Building Fintech App in Java: Tips & Trick
bertzzie
0
150
Scaling Software Architecture: 101 and Best Practices
bertzzie
0
220
Spring Cloud Contract Introduction
bertzzie
0
590
Other Decks in Technology
See All in Technology
Next.jsとNuxtが混在? iframeでなんとかする!
ypresto
2
1.4k
Oracle Cloud Infrastructureデータベース・クラウド:各バージョンのサポート期間
oracle4engineer
PRO
29
13k
生成AIが変えるデータ分析の全体像
ishikawa_satoru
0
250
New Relicを活用したSREの最初のステップ / NRUG OKINAWA VOL.3
isaoshimizu
3
670
適材適所の技術選定 〜GraphQL・REST API・tRPC〜 / Optimal Technology Selection
kakehashi
1
750
100 名超が参加した日経グループ横断の競技型 AWS 学習イベント「Nikkei Group AWS GameDay」の紹介/mediajaws202411
nikkei_engineer_recruiting
1
180
オープンソースAIとは何か? --「オープンソースAIの定義 v1.0」詳細解説
shujisado
12
1.6k
ノーコードデータ分析ツールで体験する時系列データ分析超入門
negi111111
0
430
FlutterアプリにおけるSLI/SLOを用いたユーザー体験の可視化と計測基盤構築
ostk0069
0
220
飲食店データの分析事例とそれを支えるデータ基盤
kimujun
0
230
The Rise of LLMOps
asei
9
2k
VideoMamba: State Space Model for Efficient Video Understanding
chou500
0
260
Featured
See All Featured
Rebuilding a faster, lazier Slack
samanthasiow
79
8.7k
Designing Experiences People Love
moore
138
23k
Fashionably flexible responsive web design (full day workshop)
malarkey
405
65k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
506
140k
We Have a Design System, Now What?
morganepeng
50
7.2k
Thoughts on Productivity
jonyablonski
67
4.3k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
232
17k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
33
1.9k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
191
16k
VelocityConf: Rendering Performance Case Studies
addyosmani
326
24k
A Philosophy of Restraint
colly
203
16k
A Tale of Four Properties
chriscoyier
156
23k
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