SlideShare a Scribd company logo
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Daichi Egawa, Solutions Architect
Amazon Web Services Japan K.K.
2018.12.12
Dive Deep on
Amazon Aurora with
PostgreSQL Compatibility
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Agenda
• はじめに
• Aurora Overview
• PostgreSQL Compatibility
• Architecture from PostgerSQL Perspective
• まとめ
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
みなさまの Aurora 利用状況を教えてください!
• Aurora の話を初めて聞く
• Aurora をまだ利用したことはないが、AWS Black Belt
Online Seminar などで話を聞いたことがある
• Aurora を既に利用中である
 それは MySQL Compatible-edition だ
 それは PostgreSQL Compatible-edition だ
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AWSのサービス群
ネットワーク アナリティクスコンピュート
ストレージ & 配信
開発ツール 管理ツール セキュリティ
アプリケーションサービス
モバイルサービス データベース エンタープライズアプリ
S3 CloudFront EFS Glacier
Storage
Gateway
API
Gateway
AppStream CloudSearch
Elastic
Transcoder
SES SQS SWF
Device
Farm
Mobile
Analytics
Cognito SNS RDS DynamoDB ElastiCache RedShift WorkSpaces WorkDocs WorkMail
Lambda
EC2 Container
Service
Elastic
Beanstalk
EC2 VPC
Direct
Connect
Route 53 EMR
Data
Pipeline
Kinesis
Machine
Learning
Elastic Load
Balancing
QuickSight
Elasticsearch
Service
CodeCommit CodeDeploy CodePipeline CloudWatch
Cloud
Formation
CloudTrail Config OpsWorks
Service
Catalog
Identity &
Access
Management
Directory
Service
Trusted
Advisor
Cloud HSM
Key
Management
Service
Web App
Firewall
SnowballDMS
IOT
IoT
Hubs
Mobile
Hub
CodeBuild
Athena
AI
Lex
Machine
Learning
Polly Rekognition
GameLift
ゲーム
Pinpoint
Step
Functions
Amazon Relational Database Services
移行
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
• フルマネージドな
リレーショナルデータベース
• シンプルかつ迅速にスケール
• 高速、安定したパフォーマンス
• 低コスト、従量課金
Amazon
RDS
Amazon RDS 概要
Amazon Aurora
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
オンプレミス On EC2 RDS
リレーショナルデータベースの
デプロイメントモデル
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
データベース管理のフルマネージド化による
運用負荷の軽減
Power, HVAC, net
Rack & stack
Server maintenance
OS patches
DB s/w patches
Database backups
Scaling
High availability
DB s/w installs
OS installation
App optimization
Power, HVAC, net
Rack & stack
Server maintenance
OS patches
DB s/w patches
Database backups
Scaling
High availability
DB s/w installs
OS installation
App optimization
Power, HVAC, net
Rack & stack
Server maintenance
OS patches
DB s/w patches
Database backups
Scaling
High availability
DB s/w installs
OS installation
App optimization
オンプレミス On EC2 RDS
お客様
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
データベース管理者(DBA)は
より付加価値の高い仕事に集中できる
これまでのDBA
バックアップスクリプトの作成、
仕掛け
障害時のフェイルオーバー運用、
障害サーバーの再構築
パッチ適用やスケールのための
メンテナンス作業
各種ログ・メトリクスの可視化、
アラート設定
ハードウェア、ソフトウェアの
保守切れによるマイグレーション
これからのDBA
各データベースエンジンの特性を
理解して、パフォーマンスを
チューニング
ログ・メトリクスからボトルネッ
クを特定、解消
新しい施策に向けた検証や
ベンチマーク
データベースを中心とした
全体的なシステムアーキテクト
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Aurora Overview
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
リレーショナルデータベースをもう一度考える
• 今、データベースを再度実装するならどうするか?
 スタックの分割
 以下のようなことを実装:
 スケールアウト
 セルフヒーリング
 分散サービスの活用
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Amazon Aurora
特徴 (http://aws.amazon.com/jp/rds/aurora/)
• MySQL5.6, 5.7, PostgreSQL 9.6, 10との互換性
• 3AZに6本のディスクに書き込み2本のディスク障害では
Read/Write可能。3本のディスク障害でもRead可能
• キャシュとログをAuroraプロセスから分離することで
Auroraプロセスのリスタートでもキャッシュが残る
• レプリケーション遅延は10-20ms程
• 64TBまでディスクがシームレスにスケールする
価格体系 (http://aws.amazon.com/jp/rds/aurora/pricing/)
• 選択したインスタンスタイプ
• 実際に利用したディスク容量 (プロビジョニング不要)
• バックアップストレージ容量
Amazonがクラウド時代に再設計したデータベース
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Service Oriented Architecture
• ログとストレージレイヤを
シームレスにスケールする
ストレージサービスに移動
• EC2, VPC, DynamoDB, SWF,
Route 53 などのAWSサービスを
管理コンポーネントに採用
• Amazon S3 を利用して
99.999999999% の耐久性で
ストリーミングバックアップ
Amazon
DynamoDB
Amazon SWF
Amazon Route 53
Logging + Storage
SQL
Transactions
Caching
Amazon S3
Amazon RDS
Data Plane Control Plane
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
キャッシュレイヤの分離
• キャッシュレイヤは通常、データベース
プロセス内にある – データベースがダウ
ンした場合、消去される
• キャッシュをデータベースプロセス外に
移動
• データベースプロセスのリスタートが発
生してもキャッシュが残った状態を維持
可能
• サービスにすぐデータベースを戻すこと
が出来る
• 高速なクラッシュリカバリ + 保持可能な
キャッシュ = DB障害から高速に復帰可能
SQL
Transactions
Caching
SQL
Transactions
Caching
SQL
Transactions
Caching
キャッシュプロセスをDBプロセス外におくことで
DBプロセスの再起動でもキャッシュが残る
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Aurora を構成するコンポーネント
詳細:http://docs.aws.amazon.com/ja_jp/AmazonRDS/latest/UserGuide/Aurora.Overview.html
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Aurora を構成するコンポーネント
• DB クラスター
 Amazon Aurora の管理単位
 プライマリインスタンス、レプリカ、クラスターボリュームの総称
• プライマリインスタンス(Writer)
 読み込み、書き込みを行うマスターインスタンス
• Aurora レプリカ(Reader)
 読み込みをスケールアウトさせるレプリカ(15台まで作成可能)
• クラスターボリューム (Amazon Aurora ストレージ) (詳細は後述)
 3つの AZ 間でレプリケートされる仮想ボリューム
 プライマリインスタンスもレプリカも同じクラスターボリュームを利用
• Aurora エンドポイント(詳細は後述)
 Aurora の接続先を示す URL
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Aurora Storage and Replicas
RW
Application Application
AZ-1 AZ-2 AZ-3
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AZ-1 AZ-2 AZ-3
Aurora Storage and Replicas
RW
Application Application
Write log
records
Read
blocks
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
RO
Application
AZ-1 AZ-2 AZ-3
Aurora Storage and Replicas
RW
Application
RO
Application
Async
Invalidation
& Update
Async
Invalidation
& Update
Write log
records
Read
blocks
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
RO
Application
AZ-1 AZ-2 AZ-3
Aurora Storage and Replicas
RW
Application
RO
Application
Async
Invalidation
& Update
Async
Invalidation
& Update
Write log
records
Read
blocks
RW
昇格
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
RO
Application
AZ-1 AZ-2 AZ-3
Aurora Storage and Replicas
RW
Application
RO
Application
Async
Invalidation
& Update
Async
Invalidation
& Update
Write log
records
Read
blocks
RW
64TB まで自動的にスケールするストレージ
RO
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
ディスク障害検知と修復
• 2つのコピーに障害が起こっても、読み書きに影響は無い
• 3つのコピーに障害が発生しても読み込みは可能
• 自動検知、修復
SQL
Transaction
AZ 1 AZ 2 AZ 3
Caching
SQL
Transaction
AZ 1 AZ 2 AZ 3
Caching
読み書き可能読み込み可能
詳細: https://aws.amazon.com/jp/blogs/news/amazon-aurora-under-the-hood-quorum-and-correlated-failure/
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
PostgreSQL Compatibility
P o s t g r e S Q L F o r A u r o r a
2017/10/24 GA リリース!(Virginia, Ohio, Oregon, Ireland)
2017/11/22 Region Expansion(Canada , Frankfurt, Sydney,Mumbai)
2018/2/8 Region Expansion(Tokyo)
低コスト
PostgreSQL 9.6互換
PostgreSQL 10 互換
ハイパフォーマンス スケーラブル、
堅牢かつセキュア
スナップショット経由で
RDS for PostgreSQL から
移行可能
Amazon Aurora with PostgreSQL Compatiblity
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
PostgreSQL Compatibility
• PostgreSQL 9.6, 10 との互換性
 SQL
 クライアントアプリケーション(psql, pg_dump など)
 プロシージャ(PL/pgSQL など)
• RDS for PostgreSQL で利用可能な拡張モジュールを利用可能
 例)PL/pgSQL, pgcypto, PostGIS, pg_hint_plan, orafce など
※ その他のモジュールについては以下のドキュメントを参照ください
http://docs.aws.amazon.com/ja_jp/AmazonRDS/latest/UserGuide/CHAP_PostgreS
QL.html#PostgreSQL.Concepts.General.FeatureSupport.Extensions.96x
※ wal2json についてはサポートされていません
参考) https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/Aurora.AuroraPostgreSQL.Compare.html
• RDS for PostgreSQL のスナップショットから移行可能
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Aurora with PostgreSQL Compatibility:
新しいメジャーバージョン 10系(10.4)をリリース
• PostgreSQL 10.4 に対応(Aurora PostgreSQL としては v2.0)
– 主な新機能:
• ネイティブ・パーティショニング(宣言的パーティショニング)
• パラレルクエリ強化(パラレルクエリに対応するScan方式、Join方式の追加)
• postgres_fdw強化(リモートサーバでの集約に対応)
→その他: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/AuroraPostgreSQL.Updates.20180305.html
• 対応リージョン:
– US East (バージニア北部, オハイオ),
US West (オレゴン), Europe (アイルランド)
詳細: https://aws.amazon.com/jp/about-aws/whats-new/2018/09/amazon-aurora-postgresql-compatibility-supports-postgresql104/
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
RDS for PostgreSQL と同じ拡張モジュールが利用可能
GIS(地理情報システム)オブジェクト
• postgis, postgis_tiger_geocoder, postgis_topology
データ暗号化・復号
• pgcrypto
手続き言語(ストアドプロシージャ)
• plperl, plpgsql, pltcl, plv8
実行されたSQLの統計情報の出力
• pg_stat_statements
ヒント句による実行計画の制御
• pg_hint_plan
http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_PostgreSQL.html#PostgreSQL.Concepts.General.FeatureSupport.Extensions
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Architecture from
PostgerSQL Perspective
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
IO traffic in Amazon RDS for PostgreSQL
EBSに書き込み – EBSがミラーへ複製し、両方終了後ack
スタンバイインスタンス側のEBSに書き込み
IO FLOW
ステップ1, 3, 5はシーケンシャルかつ同期
それによりレイテンシーもパフォーマンスのゆらぎも増加
各ユーザー操作には様々な書き込みタイプがある
書き込み破損を避けるためにデータブロックを2回書く必要性
OBSERVATIONS
RDS FOR POSTGRESQL WITH MULTI-AZ
EBS mirrorEBS mirror
AZ 1 AZ 2
Amazon S3
EBS
Amazon Elastic
Block Store
(EBS)
Primary
Database
Node
Standby
Database
Node
1
2
3
4
5
WAL DATA COMMIT LOG & FILES
T Y P E O F W RIT E
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
IO traffic in Aurora (データベース)
AZ 1 AZ 3
Primary
instance
Amazon S3
AZ 2
Replica
instance
AMAZON AURORA
ASYNC
4/6 QUORUM
DISTRIBUTED
WRITES
IO FLOW
REDOログレコードのみ書き込む; 全てのステップは非同期
データブロックは書かない(チェックポイント, キャッシュ置換時)
6倍のログ書き込みだが, 1/9のネットワークトラフィック
ネットワークとストレージのレイテンシー異常時の耐性
OBSERVATIONS
PERFORMANCE
REDOログレコードをまとめる – 完全にLSN順に並ぶ
適切なセグメントに分割する – 部分ごとに並ぶ
ストレージノードへまとめて書き込む
DATAAMAZON AURORA + WAL LOG COMMIT LOG & FILESWAL
T Y P E O F W RIT E
write-only もしくは、read/write が混在するワークロードに
て、PostgreSQL のコミュニティエディションに比べて、2倍
以上の性能を発揮
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
IO traffic in Aurora (ストレージノード)
LOG RECORDS
Primary
instance
INCOMING QUEUE
STORAGE NODE
S3 BACKUP
1
2
3
4
5
6
7
8
UPDATE
QUEUE
ACK
HOT
LOG
DATA
BLOCKS
POINT IN TIME
SNAPSHOT
GC
SCRUB
COALESCE
SORT
GROUP
PEER-TO-PEER GOSSIPPeer
storage
nodes
全てのステップは非同期
ステップ1と 2だけがフォアグラウンドのレイテンシーに影響
インプットキューはPostgreSQLに比べて極めて小さい
レイテンシーにセンシティブな操作に向く
ディスク領域をバッファーに使ってスパイクに対処
OBSERVATIONS
IO FLOW
① レコードを受信しインメモリのキューに追加
② レコードをSSDに永続化してACK
③ レコードを整理してギャップを把握
④ ピアと通信して穴埋め
⑤ ログレコードを新しいバージョンのデータブロックに合体
⑥ 定期的にログと新しいバージョンのブロックをS3に転送
⑦ 定期的に古いバージョンのガベージコレクションを実施
⑧ 定期的にブロックのCRCを検証
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Concurrency — Remove Log Buffer
Queued Work
Log Buffer
PostgreSQL Aurora PostgreSQL
Storage
A Queued Work
Storage
B C D E
0 0 0 0 0
A B C D E
2 2 1 0 1
A B C D E
4 3 4 2 4
A B C D E
6 5 6 3 5
A B C D E
Durability
Tracking
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
PostgreSQL における
Checkpointと Full-Page Writes
Block in
Memory
PostgreSQL
update t set y = 6;
Checkpoint
Datafile
Full
Block
WAL
Archive
4K
4K
8K
クラッシュリカバリ中、
PostgreSQL は Full page write を
実施し、問題のあるブロックを置換
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Aurora PostgreSQL—Writing Less
Block in
Memory
RDS for PostgreSQL Aurora
update t set y = 6; update t set y = 6;
Checkpoint
Datafile
Full
Block
WAL
Archive
Block in
Memory
Aurora
Storage
no checkpoint
=
no Full page write
Amazon S3
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
1-
200
1-
100
101-
200
Insert
124
1-50
51-
100
1-25
26-
50
51-
75
76-
100
101-
150
151-
200
101-
125
126-
150
151-
175
176-
200
Insert 99
1-
200
101-
200
101-
150
101-
125
4 blocks
loaded
1-
100
51-
100
76-
100
3 blocks
loaded
151-
200
151-
200
2 blocks
loaded
Insert 161
At least 3 FPW
Insert a Random Value into a B-Tree
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Insert Test
Test Table
• UUID PK—Random
• ID int—Right Lean Sequence
• VARCHAR(100)—Random
• VARCHAR(50)—Small Set of Words
• INT—Random
• INT—Random (smaller set)
• BOOLEAN—Random (50/50)
• BOOLEAN—Somewhat Random (75/25)
• Timestamp—Right Lean
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Insert Workload—PostgreSQL 9.6
0
5,000
10,000
15,000
20,000
25,000
30,000
1 31 61 91 121 151 181 211 241 271
InsertsPerSecond
Minutes
Insert Workload—PostgreSQL 9.6
BASE 16GB Max WAL Aurora PostgreSQL
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Update Test
Test Table
• UUID PK—Random
• ID int—Right Lean Sequence
• VARCHAR(100)—Random
• VARCHAR(50)—Small Set of Words
• INT—Random
• INT—Random (smaller set)
• BOOLEAN—Random (50/50)
• BOOLEAN—Somewhat Random (75/25)
• Timestamp—Right Lean
UPDATE #1
UPDATE #2
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Update Workload—PostgreSQL 9.6
3,729
4,871
17,158
-
5,000
10,000
15,000
20,000TPS(2UpdatesperTransaction)
Update Workload—PostgreSQL 9.6
BASE 16GB Max WAL Aurora PostgreSQL
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Amazon Aurora Recovers Up to 97%Faster
3 GiB Redo
Recovered in 19
seconds
10 GiB Redo
Recovered in 50
seconds
30 GiB Redo
Recovered in 123
seconds
0
20
40
60
80
100
120
140
160
0 20,000 40,000 60,000 80,000 100,000 120,000 140,000
RecoveryTimeinSeconds(lessisbetter)
Writes / Second (more is better)
RECOVERY TIME FROM CRASH UNDER LOAD
Bubble size represents redo log, which must be recovered
通常の PostgreSQL で
はスループットの上昇
とともに、ログサイ
ズ、クラッシュリカバ
リの時間も大きなって
いる
Amazon Aurora ではredoを持たない。
非常に高いスループットを維持しなが
ら、3秒程度リカバリが完了
ストレージシステムのリカバリが高速に実行可能
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Vacuuming
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
なぜ Vacuum が重要か
tuple1
tuple2
tuple3
tuple4
tuple5
tuple6
tuple1tuple1
tuple2 tuple2
tuple7
tuple8
tuple9
tuple10
Run Vacuumtuple3
tuple4
tuple3
tuple4
tuple1
tuple2
tuple3
tuple4
tuple5
tuple6
tuple1tuple1
tuple2 tuple2
tuple7
tuple8
tuple9
tuple10
No Vacuumtuple3
tuple4
tuple3
tuple4
Vacuum を実行しない場合、不要領域を回収できずより多くのブロックが必要に。
それにより、キャッシュミスの増加、HOT更新が利用できない、Full Page Write の
増加につながる。
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
4,000
5,000
6,000
7,000
8,000
9,000
10,000
1 61 121 181 241 301 361 421 481 541 601 661 721 781 841 901 961 1021 1081 1141 1201 1261
TPS
Minutes
トランザクションID周回問題にも要注意
Updates—No Vacuum Running
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
トランザクションID周回の早期検知のための運用
• CloudWatch による監視とアラーム通知を設定可能
• メトリクス:MaximumUsedTransactionIDs
• 更新頻度などに応じた適切な閾値を元にアラーム設定
詳細: https://aws.typepad.com/sajp/2017/01/implement-an-early-warning-system-for-transaction-id-wraparound-in-amazon-rds-for-postgresql.html
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Intelligent Vacuum Prefetch
PostgreSQL
Aurora PostgreSQL
Submit
Batch I/O
:凍結(frozen)状態 – Vacuumが不要
:non frozen – Vacuumが必要
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
さいごに
低コスト
PostgreSQL 9.6互換
PostgreSQL 10 互換
ハイパフォーマンス スケーラブル、
堅牢かつセキュア
スナップショット経由で
RDS for PostgreSQL から
移行可能
Amazon Aurora with PostgreSQL Compatiblity
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
まとめ
• クラウド時代に Amazon が再設計したRDBMS
 スケーラブル、高い堅牢性、可用性をもつ設計
 PostgreSQL 9.6, 10 と互換性があり既存資産を流用しやすい
• 高可用性・実環境での性能向上を実現するための
多くのチャレンジ/改善を継続して実行中
 No checkpoint
 Intelligent Vacuum Prefetch
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
アンケートへのご協力をお願いします!
以下のQRコード or URL よりアンケートのご回答を
お願いします。
※ ご回答いただいた方に本日の資料リンクをお送りします
https://bit.ly/2EkzC0w
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
参考資料
Amazon Aurora Storage論文(英語)
• http://www.allthingsdistributed.com/files/p1041-verbitski.pdf
• https://dl.acm.org/citation.cfm?id=3196937&dl=ACM&coll=DL
Amazon Auroraストレージエンジン
• http://aws.typepad.com/sajp/2017/02/introducing-the-aurora-storage-engine.html
Amazon Auroraストレージのquorumに関する実装について
• https://aws.amazon.com/jp/blogs/news/amazon-aurora-under-the-hood-quorum-and-correlated-failure/
• https://aws.amazon.com/jp/blogs/news/amazon-aurora-under-the-hood-quorum-reads-and-mutating-state/
• https://aws.amazon.com/jp/blogs/news/amazon-aurora-under-the-hood-reducing-costs-using-quorum-sets/
• https://aws.amazon.com/jp/blogs/news/amazon-aurora-under-the-hood-quorum-membership/
re:invent 2017 Aurora with PostgreSQL Compatibility 関連セッション
• Deep Dive on the Amazon Aurora PostgreSQL-compatible Edition:
https://www.youtube.com/watch?v=nd_BT_H-vsM
• Report from the Field on Amazon Aurora Performance:
https://www.youtube.com/watch?v=6kDP-95YJKU
• How Verizon is Adopting the Amazon Aurora PostgreSQL-compatible:
https://www.youtube.com/watch?v=tb6s_sSrXPY
AWS Database Blog (Amazon Aurora)
• https://aws.amazon.com/blogs/database/category/aurora/
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

More Related Content

What's hot (20)

PDF
202110 AWS Black Belt Online Seminar AWS Site-to-Site VPN
Amazon Web Services Japan
 
PDF
[Aurora事例祭り]Amazon Aurora を使いこなすためのベストプラクティス
Amazon Web Services Japan
 
PDF
AWS Black Belt Online Seminar 2017 Amazon ElastiCache
Amazon Web Services Japan
 
PDF
Kinesis + Elasticsearchでつくるさいきょうのログ分析基盤
Amazon Web Services Japan
 
PDF
Infrastructure as Code (IaC) 談義 2022
Amazon Web Services Japan
 
PDF
AWS Black Belt Online Seminar Elastic Load Balancing
Amazon Web Services Japan
 
PDF
20190604 AWS Black Belt Online Seminar Amazon Simple Notification Service (SNS)
Amazon Web Services Japan
 
PDF
アーキテクチャから理解するPostgreSQLのレプリケーション
Masahiko Sawada
 
PDF
20201111 AWS Black Belt Online Seminar AWS CodeStar & AWS CodePipeline
Amazon Web Services Japan
 
PDF
20190424 AWS Black Belt Online Seminar Amazon Aurora MySQL
Amazon Web Services Japan
 
PDF
20190130 AWS Black Belt Online Seminar AWS Identity and Access Management (AW...
Amazon Web Services Japan
 
PDF
20200623 AWS Black Belt Online Seminar Amazon Elasticsearch Service
Amazon Web Services Japan
 
PDF
20200617 AWS Black Belt Online Seminar Amazon Athena
Amazon Web Services Japan
 
PPTX
PostgreSQLのfull_page_writesについて(第24回PostgreSQLアンカンファレンス@オンライン 発表資料)
NTT DATA Technology & Innovation
 
PDF
20211203 AWS Black Belt Online Seminar AWS re:Invent 2021アップデート速報
Amazon Web Services Japan
 
PDF
AWS初心者向けWebinar AWSとのネットワーク接続入門
Amazon Web Services Japan
 
PDF
AWS Black Belt Online Seminar 2017 AWS Storage Gateway
Amazon Web Services Japan
 
PDF
[最新バージョンの情報がDescription欄にございます]AWS Black Belt Online Seminar 2018 Amazon Connect
Amazon Web Services Japan
 
PDF
AWS Black Belt Online Seminar 2017 Amazon DynamoDB
Amazon Web Services Japan
 
PDF
AWSからのメール送信
Amazon Web Services Japan
 
202110 AWS Black Belt Online Seminar AWS Site-to-Site VPN
Amazon Web Services Japan
 
[Aurora事例祭り]Amazon Aurora を使いこなすためのベストプラクティス
Amazon Web Services Japan
 
AWS Black Belt Online Seminar 2017 Amazon ElastiCache
Amazon Web Services Japan
 
Kinesis + Elasticsearchでつくるさいきょうのログ分析基盤
Amazon Web Services Japan
 
Infrastructure as Code (IaC) 談義 2022
Amazon Web Services Japan
 
AWS Black Belt Online Seminar Elastic Load Balancing
Amazon Web Services Japan
 
20190604 AWS Black Belt Online Seminar Amazon Simple Notification Service (SNS)
Amazon Web Services Japan
 
アーキテクチャから理解するPostgreSQLのレプリケーション
Masahiko Sawada
 
20201111 AWS Black Belt Online Seminar AWS CodeStar & AWS CodePipeline
Amazon Web Services Japan
 
20190424 AWS Black Belt Online Seminar Amazon Aurora MySQL
Amazon Web Services Japan
 
20190130 AWS Black Belt Online Seminar AWS Identity and Access Management (AW...
Amazon Web Services Japan
 
20200623 AWS Black Belt Online Seminar Amazon Elasticsearch Service
Amazon Web Services Japan
 
20200617 AWS Black Belt Online Seminar Amazon Athena
Amazon Web Services Japan
 
PostgreSQLのfull_page_writesについて(第24回PostgreSQLアンカンファレンス@オンライン 発表資料)
NTT DATA Technology & Innovation
 
20211203 AWS Black Belt Online Seminar AWS re:Invent 2021アップデート速報
Amazon Web Services Japan
 
AWS初心者向けWebinar AWSとのネットワーク接続入門
Amazon Web Services Japan
 
AWS Black Belt Online Seminar 2017 AWS Storage Gateway
Amazon Web Services Japan
 
[最新バージョンの情報がDescription欄にございます]AWS Black Belt Online Seminar 2018 Amazon Connect
Amazon Web Services Japan
 
AWS Black Belt Online Seminar 2017 Amazon DynamoDB
Amazon Web Services Japan
 
AWSからのメール送信
Amazon Web Services Japan
 

Similar to [PGConf.ASIA 2018]Deep Dive on Amazon Aurora with PostgreSQL Compatibility (20)

PDF
[MANABIYA] 20180323 Amazon Aurora with PostgreSQL Compatibility
Amazon Web Services Japan
 
PDF
AWS Black Belt Online Seminar 2017 Amazon Aurora with PostgreSQL Compatibility
Amazon Web Services Japan
 
PDF
AWSデータベースアップデート2017
Amazon Web Services Japan
 
PDF
Amazon Aurora
Shinpei Ohtani
 
PDF
Best Practices for Running PostgreSQL on AWS
Amazon Web Services Japan
 
PDF
Aurora
maruyama097
 
PDF
[db tech showcase Tokyo 2015] A33:Amazon Aurora Deep Dive by アマゾン データ サービス ジャ...
Insight Technology, Inc.
 
PDF
はじめてのAmazon Aurora
Jun Okubo
 
PDF
エンタープライズワークロードにおけるAmazon Auroraの活用
Amazon Web Services Japan
 
PDF
Using Amazon Aurora for Enterprise Workloads
Amazon Web Services Japan
 
DOCX
Aurora features
拓也 岸本
 
PDF
Amazon Aurora Deep Dive (db tech showcase 2016)
Amazon Web Services Japan
 
PDF
postgresql conference 2018 on-premise to rds
Yukiya Hayashi
 
PDF
AWSのデータベースサービス全体像
Amazon Web Services Japan
 
PDF
AWS Black Belt Online Seminar 2017 Amazon Aurora
Amazon Web Services Japan
 
PDF
AWS Black Belt Online Seminar Amazon Aurora
Amazon Web Services Japan
 
PDF
Amazon Aurora - Auroraの止まらない進化とその中身
Amazon Web Services Japan
 
PDF
AWSサービスアップデートまとめ (re:Invent 2016とその前後)
Amazon Web Services Japan
 
PDF
AWS Black Belt Techシリーズ Amazon Relational Database Service (RDS)
Amazon Web Services Japan
 
PDF
Amazon Aurora Deep Dive (re:Invent 2015 DAT405 日本語翻訳版)
Amazon Web Services Japan
 
[MANABIYA] 20180323 Amazon Aurora with PostgreSQL Compatibility
Amazon Web Services Japan
 
AWS Black Belt Online Seminar 2017 Amazon Aurora with PostgreSQL Compatibility
Amazon Web Services Japan
 
AWSデータベースアップデート2017
Amazon Web Services Japan
 
Amazon Aurora
Shinpei Ohtani
 
Best Practices for Running PostgreSQL on AWS
Amazon Web Services Japan
 
Aurora
maruyama097
 
[db tech showcase Tokyo 2015] A33:Amazon Aurora Deep Dive by アマゾン データ サービス ジャ...
Insight Technology, Inc.
 
はじめてのAmazon Aurora
Jun Okubo
 
エンタープライズワークロードにおけるAmazon Auroraの活用
Amazon Web Services Japan
 
Using Amazon Aurora for Enterprise Workloads
Amazon Web Services Japan
 
Aurora features
拓也 岸本
 
Amazon Aurora Deep Dive (db tech showcase 2016)
Amazon Web Services Japan
 
postgresql conference 2018 on-premise to rds
Yukiya Hayashi
 
AWSのデータベースサービス全体像
Amazon Web Services Japan
 
AWS Black Belt Online Seminar 2017 Amazon Aurora
Amazon Web Services Japan
 
AWS Black Belt Online Seminar Amazon Aurora
Amazon Web Services Japan
 
Amazon Aurora - Auroraの止まらない進化とその中身
Amazon Web Services Japan
 
AWSサービスアップデートまとめ (re:Invent 2016とその前後)
Amazon Web Services Japan
 
AWS Black Belt Techシリーズ Amazon Relational Database Service (RDS)
Amazon Web Services Japan
 
Amazon Aurora Deep Dive (re:Invent 2015 DAT405 日本語翻訳版)
Amazon Web Services Japan
 
Ad

More from Amazon Web Services Japan (20)

PDF
202205 AWS Black Belt Online Seminar Amazon VPC IP Address Manager (IPAM)
Amazon Web Services Japan
 
PDF
202205 AWS Black Belt Online Seminar Amazon FSx for OpenZFS
Amazon Web Services Japan
 
PDF
202204 AWS Black Belt Online Seminar AWS IoT Device Defender
Amazon Web Services Japan
 
PDF
202204 AWS Black Belt Online Seminar Amazon Connect を活用したオンコール対応の実現
Amazon Web Services Japan
 
PDF
202204 AWS Black Belt Online Seminar Amazon Connect Salesforce連携(第1回 CTI Adap...
Amazon Web Services Japan
 
PDF
Amazon Game Tech Night #25 ゲーム業界向け機械学習最新状況アップデート
Amazon Web Services Japan
 
PDF
202202 AWS Black Belt Online Seminar AWS Managed Rules for AWS WAF の活用
Amazon Web Services Japan
 
PDF
202203 AWS Black Belt Online Seminar Amazon Connect Tasks.pdf
Amazon Web Services Japan
 
PDF
SaaS テナント毎のコストを把握するための「AWS Application Cost Profiler」のご紹介
Amazon Web Services Japan
 
PDF
Amazon QuickSight の組み込み方法をちょっぴりDD
Amazon Web Services Japan
 
PDF
マルチテナント化で知っておきたいデータベースのこと
Amazon Web Services Japan
 
PDF
機密データとSaaSは共存しうるのか!?セキュリティー重視のユーザー層を取り込む為のネットワーク通信のアプローチ
Amazon Web Services Japan
 
PDF
パッケージソフトウェアを簡単にSaaS化!?既存の資産を使ったSaaS化手法のご紹介
Amazon Web Services Japan
 
PDF
202202 AWS Black Belt Online Seminar Amazon Connect Customer Profiles
Amazon Web Services Japan
 
PDF
Amazon Game Tech Night #24 KPIダッシュボードを最速で用意するために
Amazon Web Services Japan
 
PDF
202202 AWS Black Belt Online Seminar AWS SaaS Boost で始めるSaaS開発⼊⾨
Amazon Web Services Japan
 
PPTX
[20220126] JAWS-UG 2022初頭までに葬ったAWSアンチパターン大紹介
Amazon Web Services Japan
 
PDF
202111 AWS Black Belt Online Seminar AWSで構築するSmart Mirrorのご紹介
Amazon Web Services Japan
 
PDF
202201 AWS Black Belt Online Seminar Apache Spark Performnace Tuning for AWS ...
Amazon Web Services Japan
 
PDF
202112 AWS Black Belt Online Seminar 店内の「今」をお届けする小売業向けリアルタイム配信基盤のレシピ
Amazon Web Services Japan
 
202205 AWS Black Belt Online Seminar Amazon VPC IP Address Manager (IPAM)
Amazon Web Services Japan
 
202205 AWS Black Belt Online Seminar Amazon FSx for OpenZFS
Amazon Web Services Japan
 
202204 AWS Black Belt Online Seminar AWS IoT Device Defender
Amazon Web Services Japan
 
202204 AWS Black Belt Online Seminar Amazon Connect を活用したオンコール対応の実現
Amazon Web Services Japan
 
202204 AWS Black Belt Online Seminar Amazon Connect Salesforce連携(第1回 CTI Adap...
Amazon Web Services Japan
 
Amazon Game Tech Night #25 ゲーム業界向け機械学習最新状況アップデート
Amazon Web Services Japan
 
202202 AWS Black Belt Online Seminar AWS Managed Rules for AWS WAF の活用
Amazon Web Services Japan
 
202203 AWS Black Belt Online Seminar Amazon Connect Tasks.pdf
Amazon Web Services Japan
 
SaaS テナント毎のコストを把握するための「AWS Application Cost Profiler」のご紹介
Amazon Web Services Japan
 
Amazon QuickSight の組み込み方法をちょっぴりDD
Amazon Web Services Japan
 
マルチテナント化で知っておきたいデータベースのこと
Amazon Web Services Japan
 
機密データとSaaSは共存しうるのか!?セキュリティー重視のユーザー層を取り込む為のネットワーク通信のアプローチ
Amazon Web Services Japan
 
パッケージソフトウェアを簡単にSaaS化!?既存の資産を使ったSaaS化手法のご紹介
Amazon Web Services Japan
 
202202 AWS Black Belt Online Seminar Amazon Connect Customer Profiles
Amazon Web Services Japan
 
Amazon Game Tech Night #24 KPIダッシュボードを最速で用意するために
Amazon Web Services Japan
 
202202 AWS Black Belt Online Seminar AWS SaaS Boost で始めるSaaS開発⼊⾨
Amazon Web Services Japan
 
[20220126] JAWS-UG 2022初頭までに葬ったAWSアンチパターン大紹介
Amazon Web Services Japan
 
202111 AWS Black Belt Online Seminar AWSで構築するSmart Mirrorのご紹介
Amazon Web Services Japan
 
202201 AWS Black Belt Online Seminar Apache Spark Performnace Tuning for AWS ...
Amazon Web Services Japan
 
202112 AWS Black Belt Online Seminar 店内の「今」をお届けする小売業向けリアルタイム配信基盤のレシピ
Amazon Web Services Japan
 
Ad

Recently uploaded (8)

PDF
20250630_aws_reinforce_2025_aws_sheild_network_security_director
uedayuki
 
PDF
生成AIパネルトーク(Interop25Tokyo APPS JAPAN M1-07,M2-07 嶋ポジショントーク)
嶋 是一 (Yoshikazu SHIMA)
 
PPTX
オープンソース界隈の利用者や技術者から見たオープンソースEDAとは? What is open source EDA from the perspecti...
Industrial Technology Research Institute (ITRI)(工業技術研究院, 工研院)
 
PDF
SIG-AUDIO 2025 Vol.02 オンラインセミナー SIG-Audioプレゼン資料_オーディオプラグイン開発_塩澤達矢.pdf
IGDA Japan SIG-Audio
 
PDF
2023年版Web3技術の理想と現実
Syuhei Hiya
 
PPTX
新卒・中途採用者向け採用ピッチ資料2025年7月版(20250702).pptx
Official74
 
PDF
AIツールを使った研究の効率化 Improving Research Efficiency with AI Tools
Tohoku University
 
PDF
go tool と Minimal Version Selection アルゴリズム
Keisuke Ishigami
 
20250630_aws_reinforce_2025_aws_sheild_network_security_director
uedayuki
 
生成AIパネルトーク(Interop25Tokyo APPS JAPAN M1-07,M2-07 嶋ポジショントーク)
嶋 是一 (Yoshikazu SHIMA)
 
オープンソース界隈の利用者や技術者から見たオープンソースEDAとは? What is open source EDA from the perspecti...
Industrial Technology Research Institute (ITRI)(工業技術研究院, 工研院)
 
SIG-AUDIO 2025 Vol.02 オンラインセミナー SIG-Audioプレゼン資料_オーディオプラグイン開発_塩澤達矢.pdf
IGDA Japan SIG-Audio
 
2023年版Web3技術の理想と現実
Syuhei Hiya
 
新卒・中途採用者向け採用ピッチ資料2025年7月版(20250702).pptx
Official74
 
AIツールを使った研究の効率化 Improving Research Efficiency with AI Tools
Tohoku University
 
go tool と Minimal Version Selection アルゴリズム
Keisuke Ishigami
 

[PGConf.ASIA 2018]Deep Dive on Amazon Aurora with PostgreSQL Compatibility

  • 1. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Daichi Egawa, Solutions Architect Amazon Web Services Japan K.K. 2018.12.12 Dive Deep on Amazon Aurora with PostgreSQL Compatibility
  • 2. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Agenda • はじめに • Aurora Overview • PostgreSQL Compatibility • Architecture from PostgerSQL Perspective • まとめ
  • 3. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. みなさまの Aurora 利用状況を教えてください! • Aurora の話を初めて聞く • Aurora をまだ利用したことはないが、AWS Black Belt Online Seminar などで話を聞いたことがある • Aurora を既に利用中である  それは MySQL Compatible-edition だ  それは PostgreSQL Compatible-edition だ
  • 4. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. AWSのサービス群 ネットワーク アナリティクスコンピュート ストレージ & 配信 開発ツール 管理ツール セキュリティ アプリケーションサービス モバイルサービス データベース エンタープライズアプリ S3 CloudFront EFS Glacier Storage Gateway API Gateway AppStream CloudSearch Elastic Transcoder SES SQS SWF Device Farm Mobile Analytics Cognito SNS RDS DynamoDB ElastiCache RedShift WorkSpaces WorkDocs WorkMail Lambda EC2 Container Service Elastic Beanstalk EC2 VPC Direct Connect Route 53 EMR Data Pipeline Kinesis Machine Learning Elastic Load Balancing QuickSight Elasticsearch Service CodeCommit CodeDeploy CodePipeline CloudWatch Cloud Formation CloudTrail Config OpsWorks Service Catalog Identity & Access Management Directory Service Trusted Advisor Cloud HSM Key Management Service Web App Firewall SnowballDMS IOT IoT Hubs Mobile Hub CodeBuild Athena AI Lex Machine Learning Polly Rekognition GameLift ゲーム Pinpoint Step Functions Amazon Relational Database Services 移行
  • 5. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. • フルマネージドな リレーショナルデータベース • シンプルかつ迅速にスケール • 高速、安定したパフォーマンス • 低コスト、従量課金 Amazon RDS Amazon RDS 概要 Amazon Aurora
  • 6. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. オンプレミス On EC2 RDS リレーショナルデータベースの デプロイメントモデル
  • 7. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. データベース管理のフルマネージド化による 運用負荷の軽減 Power, HVAC, net Rack & stack Server maintenance OS patches DB s/w patches Database backups Scaling High availability DB s/w installs OS installation App optimization Power, HVAC, net Rack & stack Server maintenance OS patches DB s/w patches Database backups Scaling High availability DB s/w installs OS installation App optimization Power, HVAC, net Rack & stack Server maintenance OS patches DB s/w patches Database backups Scaling High availability DB s/w installs OS installation App optimization オンプレミス On EC2 RDS お客様
  • 8. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. データベース管理者(DBA)は より付加価値の高い仕事に集中できる これまでのDBA バックアップスクリプトの作成、 仕掛け 障害時のフェイルオーバー運用、 障害サーバーの再構築 パッチ適用やスケールのための メンテナンス作業 各種ログ・メトリクスの可視化、 アラート設定 ハードウェア、ソフトウェアの 保守切れによるマイグレーション これからのDBA 各データベースエンジンの特性を 理解して、パフォーマンスを チューニング ログ・メトリクスからボトルネッ クを特定、解消 新しい施策に向けた検証や ベンチマーク データベースを中心とした 全体的なシステムアーキテクト
  • 9. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Aurora Overview
  • 10. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. リレーショナルデータベースをもう一度考える • 今、データベースを再度実装するならどうするか?  スタックの分割  以下のようなことを実装:  スケールアウト  セルフヒーリング  分散サービスの活用
  • 11. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Aurora 特徴 (http://aws.amazon.com/jp/rds/aurora/) • MySQL5.6, 5.7, PostgreSQL 9.6, 10との互換性 • 3AZに6本のディスクに書き込み2本のディスク障害では Read/Write可能。3本のディスク障害でもRead可能 • キャシュとログをAuroraプロセスから分離することで Auroraプロセスのリスタートでもキャッシュが残る • レプリケーション遅延は10-20ms程 • 64TBまでディスクがシームレスにスケールする 価格体系 (http://aws.amazon.com/jp/rds/aurora/pricing/) • 選択したインスタンスタイプ • 実際に利用したディスク容量 (プロビジョニング不要) • バックアップストレージ容量 Amazonがクラウド時代に再設計したデータベース
  • 12. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Service Oriented Architecture • ログとストレージレイヤを シームレスにスケールする ストレージサービスに移動 • EC2, VPC, DynamoDB, SWF, Route 53 などのAWSサービスを 管理コンポーネントに採用 • Amazon S3 を利用して 99.999999999% の耐久性で ストリーミングバックアップ Amazon DynamoDB Amazon SWF Amazon Route 53 Logging + Storage SQL Transactions Caching Amazon S3 Amazon RDS Data Plane Control Plane
  • 13. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. キャッシュレイヤの分離 • キャッシュレイヤは通常、データベース プロセス内にある – データベースがダウ ンした場合、消去される • キャッシュをデータベースプロセス外に 移動 • データベースプロセスのリスタートが発 生してもキャッシュが残った状態を維持 可能 • サービスにすぐデータベースを戻すこと が出来る • 高速なクラッシュリカバリ + 保持可能な キャッシュ = DB障害から高速に復帰可能 SQL Transactions Caching SQL Transactions Caching SQL Transactions Caching キャッシュプロセスをDBプロセス外におくことで DBプロセスの再起動でもキャッシュが残る
  • 14. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Aurora を構成するコンポーネント 詳細:http://docs.aws.amazon.com/ja_jp/AmazonRDS/latest/UserGuide/Aurora.Overview.html
  • 15. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Aurora を構成するコンポーネント • DB クラスター  Amazon Aurora の管理単位  プライマリインスタンス、レプリカ、クラスターボリュームの総称 • プライマリインスタンス(Writer)  読み込み、書き込みを行うマスターインスタンス • Aurora レプリカ(Reader)  読み込みをスケールアウトさせるレプリカ(15台まで作成可能) • クラスターボリューム (Amazon Aurora ストレージ) (詳細は後述)  3つの AZ 間でレプリケートされる仮想ボリューム  プライマリインスタンスもレプリカも同じクラスターボリュームを利用 • Aurora エンドポイント(詳細は後述)  Aurora の接続先を示す URL
  • 16. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Aurora Storage and Replicas RW Application Application AZ-1 AZ-2 AZ-3
  • 17. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. AZ-1 AZ-2 AZ-3 Aurora Storage and Replicas RW Application Application Write log records Read blocks
  • 18. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. RO Application AZ-1 AZ-2 AZ-3 Aurora Storage and Replicas RW Application RO Application Async Invalidation & Update Async Invalidation & Update Write log records Read blocks
  • 19. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. RO Application AZ-1 AZ-2 AZ-3 Aurora Storage and Replicas RW Application RO Application Async Invalidation & Update Async Invalidation & Update Write log records Read blocks RW 昇格
  • 20. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. RO Application AZ-1 AZ-2 AZ-3 Aurora Storage and Replicas RW Application RO Application Async Invalidation & Update Async Invalidation & Update Write log records Read blocks RW 64TB まで自動的にスケールするストレージ RO
  • 21. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. ディスク障害検知と修復 • 2つのコピーに障害が起こっても、読み書きに影響は無い • 3つのコピーに障害が発生しても読み込みは可能 • 自動検知、修復 SQL Transaction AZ 1 AZ 2 AZ 3 Caching SQL Transaction AZ 1 AZ 2 AZ 3 Caching 読み書き可能読み込み可能 詳細: https://aws.amazon.com/jp/blogs/news/amazon-aurora-under-the-hood-quorum-and-correlated-failure/
  • 22. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. PostgreSQL Compatibility
  • 23. P o s t g r e S Q L F o r A u r o r a 2017/10/24 GA リリース!(Virginia, Ohio, Oregon, Ireland) 2017/11/22 Region Expansion(Canada , Frankfurt, Sydney,Mumbai) 2018/2/8 Region Expansion(Tokyo)
  • 24. 低コスト PostgreSQL 9.6互換 PostgreSQL 10 互換 ハイパフォーマンス スケーラブル、 堅牢かつセキュア スナップショット経由で RDS for PostgreSQL から 移行可能 Amazon Aurora with PostgreSQL Compatiblity
  • 25. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. PostgreSQL Compatibility • PostgreSQL 9.6, 10 との互換性  SQL  クライアントアプリケーション(psql, pg_dump など)  プロシージャ(PL/pgSQL など) • RDS for PostgreSQL で利用可能な拡張モジュールを利用可能  例)PL/pgSQL, pgcypto, PostGIS, pg_hint_plan, orafce など ※ その他のモジュールについては以下のドキュメントを参照ください http://docs.aws.amazon.com/ja_jp/AmazonRDS/latest/UserGuide/CHAP_PostgreS QL.html#PostgreSQL.Concepts.General.FeatureSupport.Extensions.96x ※ wal2json についてはサポートされていません 参考) https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/Aurora.AuroraPostgreSQL.Compare.html • RDS for PostgreSQL のスナップショットから移行可能
  • 26. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Aurora with PostgreSQL Compatibility: 新しいメジャーバージョン 10系(10.4)をリリース • PostgreSQL 10.4 に対応(Aurora PostgreSQL としては v2.0) – 主な新機能: • ネイティブ・パーティショニング(宣言的パーティショニング) • パラレルクエリ強化(パラレルクエリに対応するScan方式、Join方式の追加) • postgres_fdw強化(リモートサーバでの集約に対応) →その他: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/AuroraPostgreSQL.Updates.20180305.html • 対応リージョン: – US East (バージニア北部, オハイオ), US West (オレゴン), Europe (アイルランド) 詳細: https://aws.amazon.com/jp/about-aws/whats-new/2018/09/amazon-aurora-postgresql-compatibility-supports-postgresql104/
  • 27. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. RDS for PostgreSQL と同じ拡張モジュールが利用可能 GIS(地理情報システム)オブジェクト • postgis, postgis_tiger_geocoder, postgis_topology データ暗号化・復号 • pgcrypto 手続き言語(ストアドプロシージャ) • plperl, plpgsql, pltcl, plv8 実行されたSQLの統計情報の出力 • pg_stat_statements ヒント句による実行計画の制御 • pg_hint_plan http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_PostgreSQL.html#PostgreSQL.Concepts.General.FeatureSupport.Extensions
  • 28. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Architecture from PostgerSQL Perspective
  • 29. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. IO traffic in Amazon RDS for PostgreSQL EBSに書き込み – EBSがミラーへ複製し、両方終了後ack スタンバイインスタンス側のEBSに書き込み IO FLOW ステップ1, 3, 5はシーケンシャルかつ同期 それによりレイテンシーもパフォーマンスのゆらぎも増加 各ユーザー操作には様々な書き込みタイプがある 書き込み破損を避けるためにデータブロックを2回書く必要性 OBSERVATIONS RDS FOR POSTGRESQL WITH MULTI-AZ EBS mirrorEBS mirror AZ 1 AZ 2 Amazon S3 EBS Amazon Elastic Block Store (EBS) Primary Database Node Standby Database Node 1 2 3 4 5 WAL DATA COMMIT LOG & FILES T Y P E O F W RIT E
  • 30. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. IO traffic in Aurora (データベース) AZ 1 AZ 3 Primary instance Amazon S3 AZ 2 Replica instance AMAZON AURORA ASYNC 4/6 QUORUM DISTRIBUTED WRITES IO FLOW REDOログレコードのみ書き込む; 全てのステップは非同期 データブロックは書かない(チェックポイント, キャッシュ置換時) 6倍のログ書き込みだが, 1/9のネットワークトラフィック ネットワークとストレージのレイテンシー異常時の耐性 OBSERVATIONS PERFORMANCE REDOログレコードをまとめる – 完全にLSN順に並ぶ 適切なセグメントに分割する – 部分ごとに並ぶ ストレージノードへまとめて書き込む DATAAMAZON AURORA + WAL LOG COMMIT LOG & FILESWAL T Y P E O F W RIT E write-only もしくは、read/write が混在するワークロードに て、PostgreSQL のコミュニティエディションに比べて、2倍 以上の性能を発揮
  • 31. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. IO traffic in Aurora (ストレージノード) LOG RECORDS Primary instance INCOMING QUEUE STORAGE NODE S3 BACKUP 1 2 3 4 5 6 7 8 UPDATE QUEUE ACK HOT LOG DATA BLOCKS POINT IN TIME SNAPSHOT GC SCRUB COALESCE SORT GROUP PEER-TO-PEER GOSSIPPeer storage nodes 全てのステップは非同期 ステップ1と 2だけがフォアグラウンドのレイテンシーに影響 インプットキューはPostgreSQLに比べて極めて小さい レイテンシーにセンシティブな操作に向く ディスク領域をバッファーに使ってスパイクに対処 OBSERVATIONS IO FLOW ① レコードを受信しインメモリのキューに追加 ② レコードをSSDに永続化してACK ③ レコードを整理してギャップを把握 ④ ピアと通信して穴埋め ⑤ ログレコードを新しいバージョンのデータブロックに合体 ⑥ 定期的にログと新しいバージョンのブロックをS3に転送 ⑦ 定期的に古いバージョンのガベージコレクションを実施 ⑧ 定期的にブロックのCRCを検証
  • 32. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Concurrency — Remove Log Buffer Queued Work Log Buffer PostgreSQL Aurora PostgreSQL Storage A Queued Work Storage B C D E 0 0 0 0 0 A B C D E 2 2 1 0 1 A B C D E 4 3 4 2 4 A B C D E 6 5 6 3 5 A B C D E Durability Tracking
  • 33. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. PostgreSQL における Checkpointと Full-Page Writes Block in Memory PostgreSQL update t set y = 6; Checkpoint Datafile Full Block WAL Archive 4K 4K 8K クラッシュリカバリ中、 PostgreSQL は Full page write を 実施し、問題のあるブロックを置換
  • 34. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Aurora PostgreSQL—Writing Less Block in Memory RDS for PostgreSQL Aurora update t set y = 6; update t set y = 6; Checkpoint Datafile Full Block WAL Archive Block in Memory Aurora Storage no checkpoint = no Full page write Amazon S3
  • 35. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. 1- 200 1- 100 101- 200 Insert 124 1-50 51- 100 1-25 26- 50 51- 75 76- 100 101- 150 151- 200 101- 125 126- 150 151- 175 176- 200 Insert 99 1- 200 101- 200 101- 150 101- 125 4 blocks loaded 1- 100 51- 100 76- 100 3 blocks loaded 151- 200 151- 200 2 blocks loaded Insert 161 At least 3 FPW Insert a Random Value into a B-Tree
  • 36. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Insert Test Test Table • UUID PK—Random • ID int—Right Lean Sequence • VARCHAR(100)—Random • VARCHAR(50)—Small Set of Words • INT—Random • INT—Random (smaller set) • BOOLEAN—Random (50/50) • BOOLEAN—Somewhat Random (75/25) • Timestamp—Right Lean
  • 37. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Insert Workload—PostgreSQL 9.6 0 5,000 10,000 15,000 20,000 25,000 30,000 1 31 61 91 121 151 181 211 241 271 InsertsPerSecond Minutes Insert Workload—PostgreSQL 9.6 BASE 16GB Max WAL Aurora PostgreSQL
  • 38. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Update Test Test Table • UUID PK—Random • ID int—Right Lean Sequence • VARCHAR(100)—Random • VARCHAR(50)—Small Set of Words • INT—Random • INT—Random (smaller set) • BOOLEAN—Random (50/50) • BOOLEAN—Somewhat Random (75/25) • Timestamp—Right Lean UPDATE #1 UPDATE #2
  • 39. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Update Workload—PostgreSQL 9.6 3,729 4,871 17,158 - 5,000 10,000 15,000 20,000TPS(2UpdatesperTransaction) Update Workload—PostgreSQL 9.6 BASE 16GB Max WAL Aurora PostgreSQL
  • 40. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Aurora Recovers Up to 97%Faster 3 GiB Redo Recovered in 19 seconds 10 GiB Redo Recovered in 50 seconds 30 GiB Redo Recovered in 123 seconds 0 20 40 60 80 100 120 140 160 0 20,000 40,000 60,000 80,000 100,000 120,000 140,000 RecoveryTimeinSeconds(lessisbetter) Writes / Second (more is better) RECOVERY TIME FROM CRASH UNDER LOAD Bubble size represents redo log, which must be recovered 通常の PostgreSQL で はスループットの上昇 とともに、ログサイ ズ、クラッシュリカバ リの時間も大きなって いる Amazon Aurora ではredoを持たない。 非常に高いスループットを維持しなが ら、3秒程度リカバリが完了 ストレージシステムのリカバリが高速に実行可能
  • 41. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Vacuuming
  • 42. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. なぜ Vacuum が重要か tuple1 tuple2 tuple3 tuple4 tuple5 tuple6 tuple1tuple1 tuple2 tuple2 tuple7 tuple8 tuple9 tuple10 Run Vacuumtuple3 tuple4 tuple3 tuple4 tuple1 tuple2 tuple3 tuple4 tuple5 tuple6 tuple1tuple1 tuple2 tuple2 tuple7 tuple8 tuple9 tuple10 No Vacuumtuple3 tuple4 tuple3 tuple4 Vacuum を実行しない場合、不要領域を回収できずより多くのブロックが必要に。 それにより、キャッシュミスの増加、HOT更新が利用できない、Full Page Write の 増加につながる。
  • 43. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. 4,000 5,000 6,000 7,000 8,000 9,000 10,000 1 61 121 181 241 301 361 421 481 541 601 661 721 781 841 901 961 1021 1081 1141 1201 1261 TPS Minutes トランザクションID周回問題にも要注意 Updates—No Vacuum Running
  • 44. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. トランザクションID周回の早期検知のための運用 • CloudWatch による監視とアラーム通知を設定可能 • メトリクス:MaximumUsedTransactionIDs • 更新頻度などに応じた適切な閾値を元にアラーム設定 詳細: https://aws.typepad.com/sajp/2017/01/implement-an-early-warning-system-for-transaction-id-wraparound-in-amazon-rds-for-postgresql.html
  • 45. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Intelligent Vacuum Prefetch PostgreSQL Aurora PostgreSQL Submit Batch I/O :凍結(frozen)状態 – Vacuumが不要 :non frozen – Vacuumが必要
  • 46. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. さいごに
  • 47. 低コスト PostgreSQL 9.6互換 PostgreSQL 10 互換 ハイパフォーマンス スケーラブル、 堅牢かつセキュア スナップショット経由で RDS for PostgreSQL から 移行可能 Amazon Aurora with PostgreSQL Compatiblity
  • 48. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. まとめ • クラウド時代に Amazon が再設計したRDBMS  スケーラブル、高い堅牢性、可用性をもつ設計  PostgreSQL 9.6, 10 と互換性があり既存資産を流用しやすい • 高可用性・実環境での性能向上を実現するための 多くのチャレンジ/改善を継続して実行中  No checkpoint  Intelligent Vacuum Prefetch
  • 49. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. アンケートへのご協力をお願いします! 以下のQRコード or URL よりアンケートのご回答を お願いします。 ※ ご回答いただいた方に本日の資料リンクをお送りします https://bit.ly/2EkzC0w
  • 50. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. 参考資料 Amazon Aurora Storage論文(英語) • http://www.allthingsdistributed.com/files/p1041-verbitski.pdf • https://dl.acm.org/citation.cfm?id=3196937&dl=ACM&coll=DL Amazon Auroraストレージエンジン • http://aws.typepad.com/sajp/2017/02/introducing-the-aurora-storage-engine.html Amazon Auroraストレージのquorumに関する実装について • https://aws.amazon.com/jp/blogs/news/amazon-aurora-under-the-hood-quorum-and-correlated-failure/ • https://aws.amazon.com/jp/blogs/news/amazon-aurora-under-the-hood-quorum-reads-and-mutating-state/ • https://aws.amazon.com/jp/blogs/news/amazon-aurora-under-the-hood-reducing-costs-using-quorum-sets/ • https://aws.amazon.com/jp/blogs/news/amazon-aurora-under-the-hood-quorum-membership/ re:invent 2017 Aurora with PostgreSQL Compatibility 関連セッション • Deep Dive on the Amazon Aurora PostgreSQL-compatible Edition: https://www.youtube.com/watch?v=nd_BT_H-vsM • Report from the Field on Amazon Aurora Performance: https://www.youtube.com/watch?v=6kDP-95YJKU • How Verizon is Adopting the Amazon Aurora PostgreSQL-compatible: https://www.youtube.com/watch?v=tb6s_sSrXPY AWS Database Blog (Amazon Aurora) • https://aws.amazon.com/blogs/database/category/aurora/
  • 51. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.