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
RDS Proxyを使ってAuroraと仲良くなる
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
chimame
February 19, 2020
Programming
1.3k
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
RDS Proxyを使ってAuroraと仲良くなる
HIGOBASHI.AWS #13
〜令和新春!AWSだらけのLT大会〜
chimame
February 19, 2020
More Decks by chimame
See All by chimame
Cloudflare is Agents
chimame
0
220
知って得する@cloudflare_vite-pluginのあれこれ
chimame
2
710
Boost Your Web Performance with Hyperdrive
chimame
1
600
RemixでVersion skewに立ち向かう
chimame
2
1.3k
私がエッジを使う理由
chimame
10
4.2k
GraphQL Server on Edge after that
chimame
1
1.9k
Accelerating App Dev with Cloudflare Workers
chimame
1
530
GraphQL Server on Edge
chimame
12
6.8k
エッジで輝くフロントエンド
chimame
11
7k
Other Decks in Programming
See All in Programming
気持ちぃ〜角丸 Squircle
ryu1013
0
370
Inertia Rails: The One-Person Framework with React & Friends
skryukov
0
190
AI-Powered Domain-Driven Design
ziobrando
0
360
Coding with AI: How to trust the storyteller (AWS Community Day Adria, Ljubljana 2026)
slobodan
0
130
Web Framework Benchmark Battle 2026, Any%
a_matsuda
3
3.1k
Lambda durable functionsでHuman in the Loopを楽に…楽に……
har1101
2
230
ActionController meets Protocol Buffers
sorah
1
750
クラウドエージェントは、 何がそんなに便利なのか / what makes cloud agents so useful
rkaga
3
630
作って学ぶSpring BootのAuto Configuration / JJUG Night Seminar 2026-10-19
rshindo
0
210
AI時代のTerminal環境を UNIX哲学で設計・運用する
yasunori0418
1
310
自作Discord音声botをLambda MicroVMsに移行した話 / Migrating My Discord Voice Bot to Lambda MicroVMs
akihisaikeda
0
190
[Dev Group Paris Octobre 26] Agentforce, SIforce, Claudeforce, Slackbot… on s'y retrouve ?
nabondance
0
120
Featured
See All Featured
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
133
20k
Build your cross-platform service in a week with App Engine
jlugia
234
19k
Product Roadmaps are Hard
iamctodd
55
13k
The Mindset for Success: Future Career Progression
greggifford
PRO
0
550
Paper Plane (Part 1)
katiecoart
PRO
2
12k
Sam Torres - BigQuery for SEOs
techseoconnect
PRO
0
590
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
230
23k
Digital Projects Gone Horribly Wrong (And the UX Pros Who Still Save the Day) - Dean Schuster
uxyall
1
3.6k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
254
23k
Conquering PDFs: document understanding beyond plain text
inesmontani
PRO
4
3.2k
Six Lessons from altMBA
skipperchong
29
4.5k
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
Transcript
RDS Proxyを使って Auroraと仲良くなる 2020/01/30 HIGOBASHI.AWS #13 〜令和新春!AWSだらけのLT大会〜
RDS Proxy Agenda 自己紹介 まとめ
Whoa! 名前: rito 職業: Webエンジニア (アプリケーションエンジニア) 分野: Ruby on Rails,
Nodejs, React, Docker, AWS, GCP 所属: Ateam Finergy Inc. コミュニティ: GDG Osaka Rails follow-up Osaka Osaka Web Developers Meetup twitter: @chimame_rt GitHub: chimame
“Auroraとコネクション プーリングの仕組みは 相性が悪い”
コネクションプーリングとは? 5
Application Connections 使用中 使用中 使用中 未使用 未使用
7 Q.なんで相性が悪い?
Application Connections 使用中 使用中 使用中 未使用 未使用 replica master フェイルオーバーが発生したらmaster
だったreplicaに繋いだまま
RDS Proxy Managing Connections with Amazon RDS Proxy (Preview)
AWS re:Invent 2019で発表された新しいサービス。 • その名の通りRDS(データベース)用のプロキシ • RDS接続コスト(メモリ、CPU)を肩代わりする • 接続にIAM認証が使えてセキュアになる 特に発表された段階の巷ではAWS
LambdaとRDSの接続相 性の悪さを軽減できると期待されました。 RDS Proxyとは? 10
Application Connections 使用中 使用中 使用中 未使用 未使用 Aurora RDS Proxy
new!
RDS Proxyの利点 Benefits of using RDS Proxy
コネクションプーリング問題の解決
なんで? • アプリケーションはProxyに対して、コネクションプールをしている • Auroraがフェイルオーバーして接続が借り変わるのはProxyが管理している そのため、Read/Writeが入れ替わってもアプリケーションは意識する必要がない 相性が悪いというフェイルオーバー時の動作 が解消される 14
15 Q.フェイルオーバー時の読み込みないし書 き込み不可時間はどれくらい?
16 A.接続が入れ替わる瞬間の 1.4秒間くらい発生する
def show Rails.logger.debug("start: #{Time.zone.now.iso8601(3)}") Test.where(id: 1).pluck(:id) head :ok rescue Rails.logger.debug("error:
#{Time.zone.now.iso8601(3)}") head :forbidden end
フェイルオーバーとしては20秒ほど
約1.2秒の間、Readができない事象が 発生。
def show Rails.logger.debug("start: #{Time.zone.now.iso8601(3)}") Test.create(name: "#{Time.zone.now.iso8601(3)}") head :ok rescue Rails.logger.debug("error:
#{Time.zone.now.iso8601(3)}") head :forbidden end
フェイルオーバーとしては30秒ほど
約1.4秒の間、Writeができない事象が 発生。
RDS Proxyの欠点 Disadvantages of using RDS Proxy
レイテンシーが高くなる
def start # 1万件のデータ登録にProxyのありなしでどれくらい時間差が出るか 10000.times do |i| Test.create(name: "proxy #{i}")
end end
Proxyを介した場合は約3分15秒で完了 直接接続した場合には約1分8秒で完了
Proxyを介した場合と直接繋いだ場合のネットワーク送受信のスループットに大きな差が出 た RDS Proxyを挟むことで通信が制御され る? 27
Proxyを介した場合と直接繋いだ場合のネットワーク送受信のスループットに大きな差が出 た RDS Proxyを挟むことで通信が制御され る? 28 Proxyを介した場合 直接の場合
Readエンドポイントがなくなる
ここに接続エンドポイントのスクリーンショットを貼る masterへのエンドポイントしかない
まとめ STAY 障害性の保険と考えれば 費用として悪くない フェイルオーバーに は対応できる GOOD! Readエンドポイントは直接Aurora 参照することになりそう STAY
スループットが落ちるけど プレビューだからと思いたい BAD
Thanks! Does anyone have any questions? rito@chimame