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
Let's Scale Ruby Applications with Love
Search
Bernie Chiu
July 26, 2019
Technology
1k
4
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Let's Scale Ruby Applications with Love
Bernie Chiu
July 26, 2019
Other Decks in Technology
See All in Technology
初めてのDatabricks勉強会
taka_aki
2
210
Agile and AI Redmine Japan 2026
hiranabe
4
550
Why is RC4 still being used?
tamaiyutaro
0
250
事業会社は今こそSWEを高給で雇ってWebシステムを内製しよう
masaokb
0
110
#エンジニアBooks 30分でわかる 「技術記事を書く技術」 / engineer-books 2026-06-30
jnchito
1
150
Foundry Toolkit + Lemonade Serverでローカルワークフロー開発
seosoft
0
110
フルAIで個人開発して学んだあれこれ / yuruai vol.1
isaoshimizu
0
160
5分でわかる Amazon Connect_20260608
hwangbyeonghun
0
150
次世代ランサムウェア対策の考察 / 20260704 Mitsutoshi Matsuo
shift_evolve
PRO
3
1k
AWS Security Hub CSPMの成功・失敗体験
cmusudakeisuke
0
610
AI時代における最適なQA組織の作り方
ymty
3
260
作る力から、見極める力へ — AI時代に広がるエンジニアの価値と役割
rince
0
380
Featured
See All Featured
Build The Right Thing And Hit Your Dates
maggiecrowley
39
3.2k
Ethics towards AI in product and experience design
skipperchong
2
320
The #1 spot is gone: here's how to win anyway
tamaranovitovic
3
1.1k
Breaking role norms: Why Content Design is so much more than writing copy - Taylor Woolridge
uxyall
0
330
How to build an LLM SEO readiness audit: a practical framework
nmsamuel
1
790
Making the Leap to Tech Lead
cromwellryan
135
9.9k
Navigating the Design Leadership Dip - Product Design Week Design Leaders+ Conference 2024
apolaine
1
360
Marketing Yourself as an Engineer | Alaka | Gurzu
gurzu
0
250
Building a Scalable Design System with Sketch
lauravandoore
463
34k
Unsuck your backbone
ammeep
672
58k
The Curious Case for Waylosing
cassininazir
1
410
[RailsConf 2023] Rails as a piece of cake
palkan
59
6.7k
Transcript
LET’S SCALE RUBY APPLICATIONS WITH ❤
WHO AM I ?
None
GitHub: berniechiu Twitter: berniechiu_tw Software Engineer @
OVERVIEW • Ruby and API • Ruby and Database •
Ruby and Network • Ruby and… just Ruby
WHAT MATTERS?
AVERAGES?
–DHH 「1000 requests that return in 5ms, and 200 requests
taking 2,000 ms, still get a respectable 170ms average」
Only Very Happy & Very Unhappy Credit from : https://www.youtube.com/watch?v=VPYP7oJJPdo
TUNE YOUR DESIRED METRICS
SO WHAT MATTERS? • Popular endpoints • Slow response times
None
RUBY WEB + API
RESTFUL ENTHUSIASM
None
None
None
EVEN MORE DATA?
• github.com/zdennis/activerecord-import • github.com/jamis/bulk_insert
ALWAYS KNOW WHAT RUNS UNDER RUBY
RUBY DATABASE + PAGINATIONS
None
Performance Impact
For example - Kaminari
None
None
None
KEEPING USER NAVIGATIONS INTACT?
Prefetched Count
None
None
None
ITERATIONS FROM ACTIVERECORD
FIND EACH FIND IN BATCHES • Memory saving • Fetch
limited rows on each batch/iteration • Won’t lock the whole table
BUT!
WORKING WITH UUID?
None
UUID V4 IS SORTABLE?
Credit from: https://www.postgresql.org/docs/9.6/uuid-ossp.html
Credit From: GitLab CE Custom Implementations
SPEED REGAIN
RUBY LIBRARIES + NETWORK
TYPES OF CACHING
SKIPPING TO…
LOCALLY FETCHED
None
None
None
WAIT…FIXED FOREVER FOR FIXED FOR A PERIOD
None
NO CODE CONNECTION IS FAST CODE
Connection Takes Time
COPE WITH USE CASES
RUBY X THREE
BENCHMARKING
TOOLS FOR PARTIAL CODE https://github.com/evanphx/benchmark-ips https://github.com/jondot/benchmark-ipsa
WHY NOT NATIVE • Only few iterations runs with Benchmark.bm
or Benchmark.bmbm • Display time factors instead and need to guess a random iteration counts
None
None
None
TEST YOUR THEORY
TEST YOUR THEORY Constantized One Time Calculation
TEST YOUR THEORY
TEST YOUR THEORY
SEQUEL GEM https://github.com/jeremyevans/sequel
EVERYONE CAN CONTRIBUTE
FLAME GRAPHS FROM API
TOOLS?
RACK MINI PROFILER
AN ISSUE?
None
None
HTML
None
None
None
None
None
None
VERIFY!
None
LOAD TEST!
BEWARE! • APIs might have different result in different params
body • Test with the most common set from online metrics or your own tracking
調效能就跟洗浴缸⼀一樣,拔掉 那個塞⼦子,⽔水很快就流光了了
HAPPY HACKING
QA