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
120
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
95
世界一流エンジニアの思考法を読んでみた
wakino
1
87
Other Decks in Programming
See All in Programming
IBM Bob Dojo #1 仕様駆動開発入門
oniak3ibm
PRO
0
350
外から家のPCの電源入れたい!をPHPで解決する
kawashimo0
1
120
RAG の “R” を Swift で覗いてみる 〜「意味から探す」検索の仕組み〜
nao_randd
0
120
AIに “答え“を書かせるのを やめてみた
___akari11
0
110
Embedded Swiftで作る自作USBデバイス によるiOSデバイスの自動テスト / iOSDC Japan 2026 glassfiber
glassfiber
0
310
AI が書く Go コードの品質を劇的に向上させる Linter: “declscope”
mpyw
0
480
Simple Storage Service(S3) is not simple
iwatsukayura
0
220
Findy - エンジニア向け会社紹介/Findy Company Deck
findyinc
6
400k
AI主導のプログラミング学習アプリを作ってみた
econanringo
0
110
残高管理から台帳サービスへの進化
artoy
0
180
Atomic Design, Enforced: Scaling Mobile Design Systems (next.app devCon / droidCon Berlin 2026)
steliosf
PRO
0
140
更なる可用性を求めて、5年間運用したKotlinのアプリケーションをGoでリプレイスする話
ken_tunc
0
450
Featured
See All Featured
svc-hook: hooking system calls on ARM64 by binary rewriting
retrage
2
620
How to Think Like a Performance Engineer
csswizardry
28
2.9k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
230
23k
The Organizational Zoo: Understanding Human Behavior Agility Through Metaphoric Constructive Conversations (based on the works of Arthur Shelley, Ph.D)
kimpetersen
PRO
0
490
Visualization
eitanlees
153
17k
The Illustrated Children's Guide to Kubernetes
chrisshort
51
53k
Discover your Explorer Soul
emna__ayadi
2
1.3k
Utilizing Notion as your number one productivity tool
mfonobong
4
610
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.6k
Bash Introduction
62gerente
615
220k
Navigating Algorithm Shifts & AI Overviews - #SMXNext
aleyda
1
1.6k
How to audit for AI Accessibility on your Front & Back End
davetheseo
0
580
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万レコード超えて パフォーマンスが劣化したらやってみます 乞うご期待! パーティショニング