Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Django with AWS native services.
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Kosei Kitahara
January 12, 2018
Technology
77
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Django with AWS native services.
Django AWS native なサービスとして開発する
Kosei Kitahara
January 12, 2018
More Decks by Kosei Kitahara
See All by Kosei Kitahara
Twelve-Factor Python (Django) Application with Docker
surgo
0
490
Other Decks in Technology
See All in Technology
設計の世代交代を乗り越える、14年続くAndroidアプリの開発戦略
sansantech
PRO
1
150
Azure App Service / Container Apps の組み込み認証
kuniteru
0
210
AIで仕事のやり方を変える
matsu7874
2
980
ブラウザアプリの継続的パフォーマンスモニタリング (序) / Continuous Browser Application Performance Monitoring; Act 1
moznion
0
110
コスト最適化の「めんどくさい」を AWS FinOps Agent でチョット楽にする
classmethod_kaz
0
270
深夜のクラウド懺悔室 1:29:300 or 1:0:0
kazzpapa3
0
190
V8コントリビュート超入門
riyaamemiya
0
150
Sigmaユーザーのための有用リソース一挙公開 & Sigmaで使えるMCP #sigma_ucj /useful-resources-for-sigma-computing-users-and-mcps-with-sigma
shinyaa31
0
150
AI時代のAPI品質を支えるガードレール / API Guardrails for API quality in the AI era
yokawasa
1
160
Bet AI Day 2026丨Agentは、「金融」という巨大産業の何を変えられるのか
layerx
PRO
0
1.2k
Webとヘルスデータ
yukukotani
1
200
振り返りこそエンジニアの本領
negima
0
330
Featured
See All Featured
A Modern Web Designer's Workflow
chriscoyier
698
190k
How to Grow Your eCommerce with AI & Automation
katarinadahlin
PRO
1
260
エンジニアに許された特別な時間の終わり
watany
108
250k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
12
1.3k
Lightning talk: Run Django tests with GitHub Actions
sabderemane
0
250
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
201
76k
The Language of Interfaces
destraynor
162
27k
Visual Storytelling: How to be a Superhuman Communicator
reverentgeek
2
650
How to build a perfect <img>
jonoalderson
1
6k
How to Get Subject Matter Experts Bought In and Actively Contributing to SEO & PR Initiatives.
livdayseo
0
190
WCS-LA-2024
lcolladotor
0
820
Art, The Web, and Tiny UX
lynnandtonic
304
22k
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 のオー トスケー ルが追いつかない ( スパイク) スケジュー ルで頑張るのと母数を増やす ( みんな頑張って~)