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
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
複数ドメインを一つのアプリに統合するFlutterの設計と運用_FlutterKaigi2026登壇資料(須永高弘)
takahirosunaga
0
150
Event is what happens
moro
2
3.5k
LLM 101
dalinaum
0
470
[DroidKnights 2026] Workflow AX: From Auto-Documented Policies to E2E Testing
raeminkang
0
520
小さなアプリを作って公開するまで
onozaty
0
120
動画プレイヤーはなぜカクつくのか 〜Flutterのレンダリングとネイティブの境界を解剖する〜
naruogram
0
330
Vapor Mode でアクセシビリティは 壊れないか検証した話
fuqda
1
320
React Native에 현대적인 빌드 도구 더하기: Rollipop 구현기
leegeunhyeok
0
180
Web Framework Benchmark Battle 2026, Any%
a_matsuda
3
3.1k
AIが実装を担う時代の「技術設計」と「チームマネジメント」
kamina_zzz
1
150
AIがコードを書いてくれる時代、我々は何を確かめるのか
yosuke_furukawa
PRO
13
5.7k
Snowflake Openflow Connector利用の勘所 / 20261024developersio2026tokyo-snowflake-openflow
kasacchiful
PRO
0
290
Featured
See All Featured
Heart Work Chapter 1 - Part 1
lfama
PRO
10
37k
Reality Check: Gamification 10 Years Later
codingconduct
0
2.4k
What the history of the web can teach us about the future of AI
inesmontani
PRO
2
790
Jess Joyce - The Pitfalls of Following Frameworks
techseoconnect
PRO
1
470
Optimizing for Happiness
mojombo
378
71k
Dominate Local Search Results - an insider guide to GBP, reviews, and Local SEO
greggifford
PRO
0
400
Discover your Explorer Soul
emna__ayadi
2
1.3k
Tips & Tricks on How to Get Your First Job In Tech
honzajavorek
1
830
It's Worth the Effort
3n
188
29k
Testing 201, or: Great Expectations
jmmastey
46
8.4k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
12
1.4k
The Impact of AI in SEO - AI Overviews June 2024 Edition
aleyda
6
1.3k
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万レコード超えて パフォーマンスが劣化したらやってみます 乞うご期待! パーティショニング