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
38
The Future of Working in IT
bertzzie
1
76
Dependency Injection in Spring
bertzzie
0
63
Scala: Lessons Learned from the Battlefield
bertzzie
0
46
Lessons We Learned Through Hell When Scaling Blibli.com
bertzzie
0
210
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
210
Spring Cloud Contract Introduction
bertzzie
0
580
Other Decks in Technology
See All in Technology
EMとして2023年度に頑張ったこと / What we did well in FY2023 as a EM
pauli
1
200
アクセス制御にまつわる改善 / Improving access control
itkq
0
580
IPUT App Dev. Co. -Overview 2024/4
iputapp
0
120
MLOpsの「壁」を乗り越える、LINEヤフーの Data Quality as Code
lycorptech_jp
PRO
8
610
[新卒向け研修資料] テスト文字列に「うんこ」と入れるな(2024年版)
infiniteloop_inc
4
17k
Kernel MemoryでAzure OpenAI Serviceとお手軽データソース連携
mitsuzono
1
270
Babylon.js JAPAN活動紹介 (2024/4)
limes2018
1
100
MapLibreとAmazon Location Service
dayjournal
1
170
エンジニア候補者向け資料2024.04.24.pdf
macloud
0
3.3k
Google Cloud Next '24でブログを10本書いた方法と勉強会を沸かせた方法
yasumuusan
0
320
データベース02: データベースの概念
trycycle
0
180
生成AIの変革の時代に、直近1年で直面した課題とその解決策
ktc_wada
0
510
Featured
See All Featured
Code Review Best Practice
trishagee
56
15k
Building a Scalable Design System with Sketch
lauravandoore
457
32k
A Modern Web Designer's Workflow
chriscoyier
689
190k
The Invisible Customer
myddelton
114
12k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
13
8.3k
Producing Creativity
orderedlist
PRO
338
39k
Automating Front-end Workflow
addyosmani
1357
200k
Optimizing for Happiness
mojombo
370
69k
Building Flexible Design Systems
yeseniaperezcruz
320
37k
Imperfection Machines: The Place of Print at Facebook
scottboms
261
12k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
33
6k
We Have a Design System, Now What?
morganepeng
44
6.8k
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