Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Handling Scale with Reactive Programming

Handling Scale with Reactive Programming

Summary of reactive programming concept and basics

Alex Xandra Albert Sim

September 29, 2018
Tweet

More Decks by Alex Xandra Albert Sim

Other Decks in Technology

Transcript

  1. 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.
  2. Who am I? • Alex Xandra Albert Sim • Principal

    Research and Development Engineer at blibli.com • [email protected] • bertzzie(.sim)
  3. Little’s Law ! = # × % L : Jumlah

    koneksi ke database λ : Load dari request W : Waktu respons database
  4. 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
  5. Solusi? • Naikkan jumlah pool / queue? • NO, karena

    hanya membantu di average case • Kenapa? • DB down 1 menit, 500 rps tetap masuk
  6. 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
  7. Queue dan Timeout • Timeout == batas sistem dianggap gagal

    • Request tidak selalu terdistribusi rapi • Average tidak sepenting Max Response Time
  8. What we miss L • Resilience: Compartmentalization • Resilience: Circuit

    Breaker • Resilience: Supervision pattern • Message passing • Actor system • BASE Pattern