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
100万レコード超えそう(その2)
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
wakio
June 20, 2024
Programming
130
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
100万レコード超えそう(その2)
wakio
June 20, 2024
More Decks by wakio
See All by wakio
AIと共に進めるお仕事の現在地
wakino
0
99
世界一流エンジニアの思考法を読んでみた
wakino
1
91
Other Decks in Programming
See All in Programming
AIがコードを書いてくれる時代、我々は何を確かめるのか
yosuke_furukawa
PRO
13
5.7k
Goコンパイラを作ってGoをもっと理解する / Build a Go compiler to better understand Go
ikura_hamu
0
120
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
580
Performance Optimization With LLMs
xleitix
0
240
Distance field of Julia set
kinakomoti321
0
150
高橋メソッドでCVE解説シリーズ 〜CVE-2026-112816〜
hakkadaikon
0
210
SFCで実現する病院・医療システムの動的組み立て式UI
koukimiura
1
170
ActionController meets Protocol Buffers
sorah
1
780
エージェントを使い続けるためのメタワーク / Meta-work for keeping using the agent
rkaga
6
2.2k
Kotlinの15年とServer-Side Kotlin
n_takehata
1
200
プロジェクトコードをキレイキレイしよう!暗黙的な参照を読み解く静的解析
ostk0069
0
200
AI時代のFlutter品質設計 — アプリ品質を守るQuality Layers
omatty198
0
360
Featured
See All Featured
The Anti-SEO Checklist Checklist. Pubcon Cyber Week
ryanjones
0
290
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
10k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
141
35k
Art, The Web, and Tiny UX
lynnandtonic
304
22k
Effective software design: The role of men in debugging patriarchy in IT @ Voxxed Days AMS
baasie
1
600
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
37
6.7k
Building an army of robots
kneath
307
47k
Abbi's Birthday
coloredviolet
4
11k
Designing for humans not robots
tammielis
254
26k
RailsConf 2023
tenderlove
30
1.6k
Dominate Local Search Results - an insider guide to GBP, reviews, and Local SEO
greggifford
PRO
0
400
The AI Revolution Will Not Be Monopolized: How open-source beats economies of scale, even for LLMs
inesmontani
PRO
3
3.8k
Transcript
100万レコード超えそう その2
自己紹介 名前:ミヤワキ 個人開発&受託開発 組込からスマホアプリまでやります 好きな言語はKotlin 山を走るのが趣味
とある家計簿アプリのお話です
基本スタンドアローンで動きますが、 家計簿の同期はサーバ経由です
現在、登録ユーザ1700人→4000人程度で 24万→87万レコードのテーブルがあります 収入・支出履歴テーブルのレコード数の推移
このまま順調にいくと 100万レコードを超えるかも!
100万レコードを超えると パフォーマンスの劣化が顕著になるらしい 実際、1回の同期に5,6秒かかる ケースもでてきた
でも安易にサーバ増強するとか 富豪的アプローチはとりたくない t3.microで頑張りたい! ※ t3.micro: vCPU2個 メモリ1GB
4個の施策 ・手動で同期してもらう ・古いデータをS3に逃がす ・Bulk Insertを使う ・パーティショニング
S3 EC2 RDS 年1の移動 ユーザ登録・ログイン 古いデータをS3に逃がす 2年分だけ保存
1万レコードの挿入(MariaDB) Bulk単位 処理時間(msec) Bulkなし 2,440 1000 410 10000 259 1万レコードの挿入(SQLite)
Bulk単位 処理時間(msec) Bulkなし 44,189 10 2,839 100 1,537 200 1,867 500 2,967 t3.micro Huawei P20lite Android9 Bulk Insertを使う
ここまでやって、現在は1回の同期が 平均90ms未満、最大3秒
100万レコード超えて パフォーマンスが劣化したらやってみます 乞うご期待! パーティショニング