$30 off During Our Annual Pro Sale. View Details »
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Django with AWS native services.
Search
Kosei Kitahara
January 12, 2018
Technology
0
65
Django with AWS native services.
Django AWS native なサービスとして開発する
Kosei Kitahara
January 12, 2018
Tweet
Share
More Decks by Kosei Kitahara
See All by Kosei Kitahara
Twelve-Factor Python (Django) Application with Docker
surgo
0
470
Other Decks in Technology
See All in Technology
Kiro Autonomous AgentとKiro Powers の紹介 / kiro-autonomous-agent-and-powers
tomoki10
0
390
Gemini でコードレビュー知見を見える化
zozotech
PRO
1
240
非CUDAの悲哀 〜Claude Code と挑んだ image to 3D “Hunyuan3D”を EVO-X2(Ryzen AI Max+395)で動作させるチャレンジ〜
hawkymisc
1
170
手動から自動へ、そしてその先へ
moritamasami
0
300
30分であなたをOmniのファンにしてみせます~分析画面のクリック操作をそのままコード化できるAI-ReadyなBIツール~
sagara
0
120
打 造 A I 驅 動 的 G i t H u b ⾃ 動 化 ⼯ 作 流 程
appleboy
0
280
AI活用によるPRレビュー改善の歩み ― 社内全体に広がる学びと実践
lycorptech_jp
PRO
1
200
AWS Trainium3 をちょっと身近に感じたい
bigmuramura
1
140
[デモです] NotebookLM で作ったスライドの例
kongmingstrap
0
130
20251209_WAKECareer_生成AIを活用した設計・開発プロセス
syobochim
6
1.5k
regrowth_tokyo_2025_securityagent
hiashisan
0
220
【AWS re:Invent 2025速報】AIビルダー向けアップデートをまとめて解説!
minorun365
4
500
Featured
See All Featured
Designing for Performance
lara
610
69k
Automating Front-end Workflow
addyosmani
1371
200k
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
10
720
Why Our Code Smells
bkeepers
PRO
340
57k
Learning to Love Humans: Emotional Interface Design
aarron
274
41k
Agile that works and the tools we love
rasmusluckow
331
21k
RailsConf 2023
tenderlove
30
1.3k
BBQ
matthewcrist
89
9.9k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
132
19k
The World Runs on Bad Software
bkeepers
PRO
72
12k
A Tale of Four Properties
chriscoyier
162
23k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
2.6k
Transcript
Django with AWS native services Django を AWS native なサー
ビスとして開発する By Kosei Kitahara (@Surgo)
今日話すこと 前回のおさらい ‑ Twelve‑Factor App テクノロジー スタック With DynamoDB With
Kinesis Firehose With Redshift
前回のおさらい Twelve‑Factor App として作っている ロー カルで動作するサー ビスと同等のサー ビスがプロダクションで もそのまま動作する アプリケー
ション構成
アプリケー ション構成 主に以下の2 つの WebApp からなる Track: エンドユー ザー の環境、
行動情報を収集 (High latency) Report: 環境や行動情報の可視化 (Low latency) 主に以下の2 つの Worker キュー からなる Aggregate: Track の情報を Report で参照可能なデー タ形式へ 変換 (High Latency) Screenshot: スクリー ンショットの取得など (Low latency)
テクノロジー スタック ( 抜粋)
利用している AWS Native Service ( 抜粋) Application Load balancer ECS
(with Application Auto Scaling) Aurora (Auto Scaling for Replicas) ElastiCache DynamoDB (Auto Scaling) SQS (Auto scaling) Redshift with Kinesis Firehose (Auto scaling)
テクノロジー 選定基準 Auto Scaling!!1 Maintenance free (managed & auto upgrade)
Work locally Work with Django native (none customized) apps django‑rest‑framework django‑registration‑redux django‑storages etc...
Aurora/Redshift 最初からシャー ディングにより書き込みを分散 まだ Aurora Multi‑Master がプレビュー なので Redshift の同時クエリー
実行数制限 https://github.com/uncovertruth/django‑horizon/ Django のデー タベー スバックエンド Aurora: 標準の MySQL ( ちょっとカスタマイズ) Redshift: https://github.com/shimizukawa/django‑redshift‑ backend Redshift 用にクエリー をチュー ニング ( 主に DISTKEY) https://github.com/onysos/django‑composite‑foreignkey
ElastiCache しょうがないけど Auto Scaling がない Auto discovery 対応のバックエンドを利用 https://github.com/uncovertruth/django‑elastipymemcache Double
write & Double read Maintenance 時間をずらした2 クラスター で双方自動更新 カジュアルに再起動 ( しないけど) そのうち DAX に移行したい
DynamoDB Amazing! (Performance, cost, maintenace free) Object Mapper https://github.com/pynamodb/PynamoDB For
local dev & testing https://github.com/spulec/moto Factory‑boy なども _ b u i l d をカスタマイズしそのまま利用 そのうち DAX & Global region へ以降する
Kinesis Firehose django form や django‑rest‑framework serializer の validation ‑>
save 機構をカスタマイズするのみ local なら直接 sqlite へ、 本番なら firehose 経由で Redshift へ という用に切り分け https://github.com/spulec/moto を利用し、 想定する API へのリク エストと引数をテストしている 現在テスト稼働で 600Krecords/hour/shard を挿入
Lesson learned Auto scaling さまさま ( 常時監視対象が大幅に減る) APM が重要 Auto
scaling しないものは自前でなんとかする Django の枠をなるべくはみ出ない Aurora と DynamoDB は世界を救う
Future tasks boto の https リクエストのオー バー ヘッドが高い DynamoDB は
DAX を利用する SQS や DynamoDB のオー トスケー ルが追いつかない ( スパイク) スケジュー ルで頑張るのと母数を増やす ( みんな頑張って~)