Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Let's Scale Ruby Applications with Love
Search
Bernie Chiu
July 26, 2019
Technology
1.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
Flutter Widget Previewerで始めるUIプレビューとVRTの自動化
sakusaku3939
0
180
Technical Project Manager の役割とやりがい、少しだけ AI
yoshiiryo1
0
390
推論基盤と Scale-Up Interconnect の現状と制約から俯瞰する技術動向
markunet
2
670
[General] 개발자로 해외 기업에서 일하기
skydoves
1
120
素人でもできた!AIを使った短編小説創作入門
delhi09
PRO
0
250
You Have Agency(サンキュー、Ruby)
snoozer05
PRO
4
610
(swiftc) NonCopyableとライフタイム修飾子
teamhimeh
0
160
[FECONF-2026] 신대륙을 향한 카카오페이증권 프론트엔드 항해기 (이주승)
l1ghthouse
0
330
E2Eってつらくないですか?E2Eの管理コストを下げる手段とその実践
akaboshinit
6
2.8k
増え続けるプロダクトの品質をどう担保するか。ProductSpecとTypeScriptによる取り組み
joere
2
250
AI Search (Foundry IQ) におけるRAGデータの準備と配置
ryomaru0825
1
100
AIがGISを代替する日:〜すべてをAIが創る時代に、私たちがFOSS4Gに関わる意味〜
lehupa
0
130
Featured
See All Featured
Paper Plane
katiecoart
PRO
5
54k
[RailsConf 2023] Rails as a piece of cake
palkan
59
7.1k
Utilizing Notion as your number one productivity tool
mfonobong
4
630
How to make the Groovebox
asonas
2
2.5k
Why You Should Never Use an ORM
jnunemaker
PRO
61
10k
Rails Girls Zürich Keynote
gr2m
96
14k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.9k
New Earth Scene 8
popppiees
4
2.7k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
2.1k
We Analyzed 250 Million AI Search Results: Here's What I Found
joshbly
2
2.1k
Why Your Marketing Sucks and What You Can Do About It - Sophie Logan
marketingsoph
0
440
Gemini Prompt Engineering: Practical Techniques for Tangible AI Outcomes
mfonobong
2
610
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