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
LambdaとSQLiteでシステム構築
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
おがどら
January 23, 2025
Technology
650
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
LambdaとSQLiteでシステム構築
ECSやRDSは高いので、LambdaやEFSで代替してみました。
おがどら
January 23, 2025
More Decks by おがどら
See All by おがどら
任意のドメインを破壊
ogadra
0
65
hono-remix-adapter使ってみた
ogadra
0
420
Terraformと AWS Lambdaで WebSocket通信
ogadra
1
270
Other Decks in Technology
See All in Technology
攻撃 3 時間 vs 復旧 10 時間。アクセスキー流出の非対称性を体感するために CTF を作った話
kazzpapa3
1
160
なぜ東京にいる私が、新潟の技術コミュニティを運営するのか by 八雲慎之助
yakumo
0
230
Kiro 入門 (1 つのエージェントを、どの画面からでも) | 目指せ Kiro マスター 01
inariku
PRO
5
1.1k
[dbts2026]数十PBの超巨大データ×AI活用を支えるSnowflakeの実力〜大規模環境におけるアーキテクチャと運用のリアル〜
y_matsubara
0
110
視野はAIに、視座は人に / ai-for-breadth-humans-for-perspective
nkzn
6
3.2k
ゼロから作るWebアプリの新定番!?Amplify Gen 2 × AWS Blocksで実現する「開発速度とRDBの柔軟性のいいとこ取り」
amixedcolor
1
170
cdkd (CDK Direct)
gotok365
4
270
Gifu WordPress Meetup #200 に向けて、私たちには何ができるだろうか?/ 2026-11-07 Gifu WordPress Meetup
torounit
0
230
In-Context Learning再入門。ICLの勾配降下的解釈の研究動向を追ってみる。
dai08srhg
1
720
現場を動かすAIエージェント#2_製造業現場でのAI活用から見た、ハマる罠と実践知
kintotechdev
2
190
仕様と現実の間で落とし所を探るリモートMCPの認証・認可 — Sansanの認証基盤における課題と実践
sansantech
PRO
1
120
基本から分かる!AWSセキュリティ運用の考え方と任せ方
cmusudakeisuke
1
450
Featured
See All Featured
WENDY [Excerpt]
tessaabrams
14
40k
Agile that works and the tools we love
rasmusluckow
331
22k
SEO Brein meetup: CTRL+C is not how to scale international SEO
lindahogenes
2
3k
16th Malabo Montpellier Forum Presentation
akademiya2063
PRO
0
450
30 Presentation Tips
portentint
PRO
1
460
How to make the Groovebox
asonas
2
2.5k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
10
1.4k
Build The Right Thing And Hit Your Dates
maggiecrowley
39
3.5k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
254
23k
How to audit for AI Accessibility on your Front & Back End
davetheseo
0
630
The Invisible Side of Design
smashingmag
301
52k
Ecommerce SEO: The Keys for Success Now & Beyond - #SERPConf2024
aleyda
1
2.2k
Transcript
Lambda とSQLite でシステム構築 おがどら
みなさん
RDS 、高すぎますよね
小規模のアプリケーションにRDS はオーバースペ ックすぎる
そこで、EFS とSQLite を使ってお安くアプリを作 成したので、ご紹介します こちらは2024 年4 月に作成しました
背景 Next.js + Prisma のアプリケーションを作って みた ECS もRDS も 高
す ぎ る 社内システムなので、可用性とかスペック とかいらない EC2 すら高い でもDocker もRDB も使いたい
結論
コストカットのための構成 RDS -> EFS 上のSQLite ECS -> VPC Lambda ALB
-> API Gateway
RDS -> SQLite on EFS PostgreSQL にしかない機能を SQLite 向けに 変更
概ねPrisma ORM がいい感じにしてくれる
Lambda から EFS にアクセス VPC Lambda として作成する EFS マウントターゲットを同一AZ に作成する
ECS -> Lambda Dockerfile にこの1 行を追加するだけ 👇🏻👇🏻 ( 紙面の都合上改行しています) COPY
--from=public.ecr.aws/awsguru/aws-lambda-adapter:0.9.0 \ /lambda-adapter /opt/extensions/lambda-adapter
VPC Lambda はWAN に出られない ENI にEIP を割り当てる必要ががある aws ec2 associate-address
\ --allocation-id $allocationId \ --network-interface-id $nicId
コスト削減効果 ECS / RDS を使うときに比べて90% 削減 月額 50 ドル →
4 ドル 移行前) ELB 18 ドル + RDS 21 ドル + ECS 11 ドル 移行後) EIP 3.6 ドル + EFS 0.4 ドル
この構成のメリット Docker の用意の手間が少ない 開発環境との差分が1 行 SQLite が使える Prisma のデフォルトDB はSQLite
初期セットアップの手間が少ない 意外と安定している 半年以上運用しているが、障害はない
この構成のデメリット インフラ用意はちょっと大変 個人開発にはオススメ 同時にSQLite に書き込むとSQLite が壊れる? NFS 上のファイルには書き込みロックがか からないため 書き込みがほぼないため無問題
まとめ 安いアーキテクチャを考えるのは楽しい!
ご清聴ありがとうございました Twitter: GitHub: @const_myself ogadra made by reveal.js