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
パフォーマンス改善
Search
takakuda
October 31, 2019
160
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
パフォーマンス改善
takakuda
October 31, 2019
More Decks by takakuda
See All by takakuda
gem version up
takakuda
0
2.3k
リファクタリング
takakuda
0
53
ぼくらのかんがえたさいきょうのfactory_bot
takakuda
0
2.7k
LINE, Messenger比べてみました。
takakuda
0
1.4k
Featured
See All Featured
sira's awesome portfolio website redesign presentation
elsirapls
0
420
Raft: Consensus for Rubyists
vanstee
142
7.7k
Typedesign – Prime Four
hannesfritz
42
3.2k
Art, The Web, and Tiny UX
lynnandtonic
304
22k
Ethics towards AI in product and experience design
skipperchong
2
380
Building AI with AI
inesmontani
PRO
1
1.2k
What the history of the web can teach us about the future of AI
inesmontani
PRO
1
700
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
56
3.5k
Mobile First: as difficult as doing things right
swwweet
225
10k
Keith and Marios Guide to Fast Websites
keithpitt
413
23k
Navigating the moral maze — ethical principles for Al-driven product design
skipperchong
2
550
JAMstack: Web Apps at Ludicrous Speed - All Things Open 2022
reverentgeek
1
600
Transcript
テクノロジー開発部 takakuda
• 自己紹介 • 大きくなったDB負荷 • logテーブルの設計 • まとめ Agenda
自己紹介
- 前職 仙台で雛人形売り - 2017.08 ~ Zeals - Ruby -
Rails ZEALS Engineer Rails エンジニア :takakuda :@kutaike1504
パフォーマンス改善
サービスが大きく成長したことによって 発生した問題とどう対処していったのか
アーキテクチャの変更
https://tech.zeals.co.jp/entry/2019/09/24/105716
なぜアーキテクチャを変更したのか?
パフォーマンスが悪くなったから
アーキテクチャ変更によって今は対応 できているけども なぜ変更する必要があったのか? どうすれば変更なしで対応できたの か?
自分の失敗より 他者の失敗から学ぶ
大きくなったDB負荷
ユーザーの行動log
大量のSQL write によって Appサーバーが落ちる
logをDBに書き込むのではなく log dataとして外部出力する
非RDB化 詳しくは弊社 TECH BLOGへ! https://tech.zeals.co.jp/entry/2019/08/26/101131
大量のSQL writeがなくなった
どうすれば大きくなるDB負荷を避ける ことができたか?
logテーブルの設計
どういう設計をすればよかったのか?
パーティション…とか?
1つのテーブルを分割して管理する仕組み 巨大なデータを複数に分割するこができ、 分割したデータごとに削除や参照ができる
log系のテーブルであれば基本的に時系列的に増えて いくものだし、現在に近いレコードに対する参照がほとん どのはず。 古いレコードを参照する場合でも特定の期間を指定する パターンが多い。 であれば日付でパーティションを切るのは有効
ただし制約もある - クエリキャッシュをサポートしない - 外部キーをサポートしない など…
データサイズに注意する どこかでデータを切り捨てることを考 える必要がある
まとめ • データサイズに注意して予め設計する
LET'S START NEXT INDUSTRIAL REVOLUTION WITH OUR FLYING SHUTTLE
Thank you!!