🗄️rds-aurora
- プラグイン
- aws-dev-toolkit
- ソース
- GitHub で見る ↗
説明
Amazon RDS および Aurora のデータベース設計、エンジン選定、高可用性構成、運用管理について深く掘り下げます。 次のような場合に使用: ユーザーが「RDS データベースを設計したい」「RDS と Aurora のどちらを選ぶべきか」「Aurora Serverless を設定したい」「リードレプリカをセットアップしたい」「データベース移行を計画したい」「RDS Proxy を設定したい」「データベースパラメータをチューニングしたい」「Multi-AZ を設定したい」「ブルー/グリーンデプロイメントを計画したい」と尋ねる場合、 または RDS、Aurora、Aurora Serverless v2、データベースフェイルオーバー、AWS 上のリレーショナルデータベース設計について言及している場合。
原文を表示
Deep-dive into Amazon RDS and Aurora database design, engine selection, high availability, and operations. This skill should be used when the user asks to "design an RDS database", "choose between RDS and Aurora", "configure Aurora Serverless", "set up read replicas", "plan a database migration", "configure RDS Proxy", "tune database parameters", "set up Multi-AZ", "plan blue/green deployments", or mentions RDS, Aurora, Aurora Serverless v2, database failover, or relational database design on AWS.
ユースケース
- ✓RDSデータベースを設計したい
- ✓RDSとAuroraの選定を検討する
- ✓Aurora Serverlessを設定したい
- ✓リードレプリカをセットアップしたい
- ✓データベース移行を計画したい
- ✓RDS Proxyを設定したい
本文(日本語訳)
Amazon RDS および Aurora に関する専門的なガイダンスです。 エンジン選択、インスタンスサイジング、高可用性、読み取りスケーリング、セキュリティ、マイグレーション、運用のベストプラクティスを網羅します。
プロセス
- ワークロードの特性を特定する: 読み取り/書き込み比率、レイテンシ要件、データ量、接続数
awsknowledgeMCPツール(mcp__plugin_aws-dev-toolkit_awsknowledge__aws___search_documentation、mcp__plugin_aws-dev-toolkit_awsknowledge__aws___read_documentation、mcp__plugin_aws-dev-toolkit_awsknowledge__aws___recommend)を使用して、現在の RDS/Aurora の制限、エンジンバージョン、機能を確認する- 適切なエンジンおよびデプロイメントモデル(RDS シングルインスタンス、RDS Multi-AZ、Aurora プロビジョンド、Aurora Serverless v2)を選択する
- 高可用性および読み取りスケーリングのトポロジを設計する
- セキュリティを設定する(暗号化、IAM 認証、ネットワーク分離)
- 運用のベストプラクティスを推奨する(バックアップ、モニタリング、メンテナンス)
エンジン選択デシジョンマトリクス
| 要件 | 推奨 | 理由 |
|---|---|---|
| MySQL/PostgreSQL、予測可能なワークロード、コスト重視 | RDS for MySQL/PostgreSQL | 小〜中規模ワークロードでシンプルかつ安価 |
| MySQL/PostgreSQL、高可用性、ストレージ自動スケーリング | Aurora(MySQL/PostgreSQL) | 6方向レプリケーションストレージ、最大 128 TB の自動拡張 |
| スパイク的または予測困難なトラフィック | Aurora Serverless v2 | 0.5 ACU 刻みでスケール、オプションでスケールトゥゼロ対応 |
| Oracle または SQL Server ライセンス | RDS for Oracle / SQL Server | AWS マネージド環境でこれらのエンジンを使用する唯一の選択肢 |
| 非常に小規模な開発/テスト用 DB | db.t4g.micro の RDS、または最小 0.5 ACU の Aurora Serverless v2 |
最低コストのエントリーポイント |
| 高書き込みスループット、グローバル展開 | Aurora Global Database | サブ秒でのクロスリージョンレプリケーション、書き込みフォワーディング |
| 既存オンプレミス PostgreSQL のマイグレーション | Aurora PostgreSQL + DMS | ワイヤー互換、アプリ変更が最小限 |
Aurora vs RDS — 主な違い
ストレージアーキテクチャ
- RDS: EBS バックエンド(gp3 または io2)、Multi-AZ でない限りシングル AZ ストレージ
- Aurora: 分散ストレージレイヤー、3 つの AZ に 6 コピー、自動ヒーリング、最大 128 TB まで自動拡張
- Aurora は書き込みで 2 コピーの損失、読み取りで 3 コピーの損失に耐えられる — 手動介入なし
レプリケーション
- RDS: 非同期リードレプリカ(MySQL は最大 15 台、PostgreSQL は最大 5 台)、レプリカごとに個別ストレージ
- Aurora: 同一ストレージボリュームを共有する最大 15 台のリードレプリカ — レプリカラグは通常 20ms 未満、多くの場合 10ms 未満
- Aurora のレプリカはデータロスなしでフェイルオーバーターゲットになれる(同一ストレージのため)
フェイルオーバー
- RDS Multi-AZ: 同期スタンバイへのフェイルオーバーに 60〜120 秒
- Aurora: リードレプリカへのフェイルオーバーは通常 30 秒未満(インプレースで昇格)
- Aurora はフェイルオーバーの優先度ティア(0〜15)によりどのレプリカを昇格するか制御可能
コスト比較
- Aurora インスタンスのコストは同等の RDS インスタンスより約 20% 高い
- Aurora は EBS の個別コストが不要 — ストレージコストは Aurora の料金に含まれる
- 読み取りが多いワークロードでは、Aurora の共有ストレージによりレプリカが安価(ストレージの重複なし)
- Aurora Serverless v2 は変動するワークロードにおいて、アイドル状態のプロビジョンドインスタンスよりコスト効率が高い場合がある
Aurora Serverless v2
- 0.5 ACU 刻みでスケール(1 ACU ≈ 2 GiB RAM + 比例した CPU)
- 最小: 0.5 ACU、最大: インスタンスあたり 256 ACU
- リクエスト数ではなく CPU、接続数、メモリプレッシャーに基づいてスケール
- 同一クラスター内で Serverless v2 とプロビジョンドインスタンスを混在させることが可能
- 推奨パターン: 変動する読み取りトラフィックには Serverless v2 リーダー、安定した書き込み負荷にはプロビジョンドライター
Serverless v2 を使用する場合
- 次のような場合に使用:
- 開発環境・ステージング環境
- アイドル期間がある(夜間、週末)アプリケーション
- スパイク的な読み取りワークロード(レポート、バッチクエリ)
- トラフィックパターンが未知の新規アプリケーション
Serverless v2 を避ける場合
- 次のような場合に使用を避ける:
- 高スループットが持続する本番環境の書き込み — 安定した状態ではプロビジョンドの方が安価
- スケールアップ中にレイテンシが問題になるワークロード(最小値からのスケーリングには秒単位の時間がかかり、即時ではない)
高可用性構成
RDS Multi-AZ(インスタンス)
- 異なる AZ に同期スタンバイ — 自動フェイルオーバー
- スタンバイは読み取り不可(Aurora レプリカとは異なる)
- 次のような場合に使用: 読み取りスケーリングを必要としないシンプルな HA が必要な本番データベース
RDS Multi-AZ(クラスター)— db.r6gd 限定
- 3 つの AZ にまたがる 1 台のライターと 2 台の読み取り可能スタンバイ
- ローカル NVMe + 同期レプリケーションを使用
- 35 秒未満のフェイルオーバー
- 特定のインスタンスクラスに限定
Aurora Multi-AZ
- HA のために異なる AZ に最低 1 台のリードレプリカを作成
- すべてのレプリカがストレージを共有するため、フェイルオーバー時のデータロスはゼロ
- 本番環境の推奨: 2 つの AZ に最低 2 台のレプリカ(ライター + 2 リーダー = 3 AZ)
Aurora Global Database
- クロスリージョンレプリケーションで典型的なラグは 1 秒未満
- 自動フェイルオーバーによる管理された RPO/RTO
- 書き込みフォワーディングにより、セカンダリリージョンのリーダーが書き込みをプライマリにリダイレクト可能
- 次のような場合に使用: ディザスタリカバリ、低レイテンシなグローバル読み取り
RDS Proxy
- アプリケーションとデータベースの間に位置するフルマネージドな接続プーラー
- 数千のアプリケーション接続をより少ないデータベース接続のプールに多重化
- スタンバイへのオープン接続を維持することでフェイルオーバー時間を短縮
- Lambda → RDS/Aurora において必須(Lambda は多数の短命な接続を生成する)
RDS Proxy を使用する場合
- 次のような場合に使用:
- RDS/Aurora に接続する Lambda 関数(接続枯渇のリスク)
- 短命な接続が多いアプリケーション
- フェイルオーバー時の影響を軽減したい場合(プロキシが新しいプライマリに自動的に切り替わる)
RDS Proxy をスキップする場合
- 次のような場合に使用を避ける:
- 永続的な接続プールを持つアプリケーション(HikariCP/pgBouncer を使用する従来型のアプリサーバーなど)
- セッションレベルの機能が必要なワークロード(プリペアドステートメント、一時テーブル — プロキシが接続をピンどめする場合がある)
セキュリティ
暗号化
- 保存データ: 作成時に有効化すること(後から有効化するにはスナップショットからのリストアが必要)。キー制御には AWS KMS CMK を使用。
- 転送中データ: パラメータグループ経由で SSL を強制する(PostgreSQL は
rds.force_ssl = 1、MySQL はrequire_secure_transport = ON)
ネットワーク分離
- プライベートサブネットにのみデプロイ — パブリック IP は絶対に割り当てない
- セキュリティグループを使用してアプリケーションサブネットからのインバウンドのみに制限
- API コールには VPC エンドポイントを使用(
rdsおよびrds-dataエンドポイント)
認証
- IAM データベース認証: トークンベースでパスワードを保存しない — Lambda や自動化されたアクセスに最適
- Secrets Manager ローテーション: スケジュールに基づいた自動パスワードローテーション — 従来のユーザー名/パスワード認証に使用
- Kerberos/Active Directory: AWS Directory Service 経由で SQL Server および Oracle に対応
Blue/Green デプロイメント
- 変更(エンジンアップグレード、パラメータ変更、スキーマ変更)を適用した本番データベースの「グリーン」コピーを作成
- RDS はロジカルレプリケーションを通じてグリーン環境を同期し続ける
- 切り替えは約 1 分でダウンタイムを最小化
- ヘルスチェックが失敗した場合は自動ロールバック
対応している変更
- メジャーエンジンバージョンのアップグレード
- パラメータグループの変更
- グリーン環境上でのスキーマ変更
- インスタンスクラスの変更
制限事項
- Aurora Serverless v1 では非対応(v2 は対応)
- 移行期間中は両環境分のキャパシティが必要
バックアップとリカバリ
自動バックアップ
- デフォルトの保持期間: 7 日(0〜35 日で設定可能、0 で無効化)
- 保持期間内の任意の秒単位でポイントインタイムリカバリ(PITR)が可能
- バックアップは S3 に保存(AWS が管理、自分のバケットには表示されない)
手動スナップショット
- 削除するまで無期限に保持
- クロスアカウント共有またはクロスリージョンコピーが可能
- 次のような場合に使用: 変更前の安全網、アーカイブ、クロスリージョン DR
Aurora バックトラック(MySQL のみ)
- リストアなしでデータベースを特定の時点に巻き戻す
- 同一クラスター上で動作 — PITR よりはるかに高速
- バックトラックウィンドウを設定(最大 72 時間)
- 次のような場合に使用: 不正なクエリや誤削除からのリカバリ
アンチパターン
- パブリックサブネットへのデータベース配置。 RDS/Aurora をパブリックサブネットに置いてはいけない。プライベートサブネットを使用し、アプリケーション層、VPN、またはバスチョン経由でアクセスすること。
- デフォルトパラメータグループの使用。 常にカスタムパラメータグループを作成すること — デフォルトのものは変更不可でチューニングが不可能。
- 暗号化なしのインスタンス。 暗号化は作成時に有効化しなければならない。後から追加するには、スナップショット → 暗号化コピー → リストア というプロセスが必要で、ダウンタイムと新しいエンドポイントが発生する。
- RDS Proxy なしでの Lambda 使用。 Lambda は呼び出しごとに新しい接続を作成する。接続プーラーなしでは、同時実行する Lambda が数秒で
max_connectionsを
原文(English)を表示
Specialist guidance for Amazon RDS and Aurora. Covers engine selection, instance sizing, high availability, read scaling, security, migration, and operational best practices.
Process
- Identify the workload characteristics: read/write ratio, latency requirements, data volume, connection count
- Use the
awsknowledgeMCP tools (mcp__plugin_aws-dev-toolkit_awsknowledge__aws___search_documentation,mcp__plugin_aws-dev-toolkit_awsknowledge__aws___read_documentation,mcp__plugin_aws-dev-toolkit_awsknowledge__aws___recommend) to verify current RDS/Aurora limits, engine versions, and features - Select the appropriate engine and deployment model (RDS single-instance, RDS Multi-AZ, Aurora provisioned, Aurora Serverless v2)
- Design the high availability and read scaling topology
- Configure security (encryption, IAM auth, network isolation)
- Recommend operational best practices (backups, monitoring, maintenance)
Engine Selection Decision Matrix
| Requirement | Recommendation | Why |
|---|---|---|
| MySQL/PostgreSQL, predictable workload, cost-sensitive | RDS for MySQL/PostgreSQL | Simpler, cheaper for small-medium workloads |
| MySQL/PostgreSQL, high availability, auto-scaling storage | Aurora (MySQL/PostgreSQL) | 6-way replicated storage, up to 128 TB auto-grow |
| Spiky or unpredictable traffic | Aurora Serverless v2 | Scales ACUs in 0.5 increments, optional scale-to-zero support |
| Oracle or SQL Server licensing | RDS for Oracle / SQL Server | Only option for these engines on managed AWS |
| Very small dev/test database | RDS with db.t4g.micro or Aurora Serverless v2 min 0.5 ACU |
Lowest cost entry points |
| High write throughput, global | Aurora Global Database | Sub-second cross-region replication, write forwarding |
| Existing on-prem PostgreSQL migration | Aurora PostgreSQL + DMS | Wire-compatible, minimal app changes |
Aurora vs RDS — Key Differences
Storage Architecture
- RDS: EBS-backed (gp3 or io2), single-AZ storage unless Multi-AZ
- Aurora: Distributed storage layer, 6 copies across 3 AZs, auto-heals, auto-grows to 128 TB
- Aurora survives loss of 2 copies for writes, 3 for reads — without manual intervention
Replication
- RDS: Async read replicas (up to 15 for MySQL, 5 for PostgreSQL), separate storage per replica
- Aurora: Up to 15 read replicas sharing the same storage volume — replica lag typically <20ms, often <10ms
- Aurora replicas can be failover targets with no data loss (same storage)
Failover
- RDS Multi-AZ: 60-120 second failover to synchronous standby
- Aurora: Typically <30 second failover to a read replica (promoted in-place)
- Aurora supports failover priority tiers (0-15) to control which replica gets promoted
Cost Comparison
- Aurora instances cost ~20% more than equivalent RDS instances
- Aurora eliminates separate EBS costs — storage is included in the Aurora pricing model
- For read-heavy workloads, Aurora's shared storage makes replicas cheaper (no storage duplication)
- Aurora Serverless v2 can be more cost-effective for variable workloads than provisioned instances sitting idle
Aurora Serverless v2
- Scales in 0.5 ACU increments (1 ACU ≈ 2 GiB RAM + proportional CPU)
- Minimum: 0.5 ACU; Maximum: 256 ACU per instance
- Scales based on CPU, connections, and memory pressure — not request count
- Can mix Serverless v2 and provisioned instances in the same cluster
- Recommended pattern: Serverless v2 reader for variable read traffic, provisioned writer for consistent write load
When to Use Serverless v2
- Development and staging environments
- Applications with idle periods (nights, weekends)
- Spiky read workloads (reporting, batch queries)
- New applications where traffic patterns are unknown
When to Avoid Serverless v2
- Sustained high-throughput production writers — provisioned is cheaper at steady state
- Latency-sensitive workloads during scale-up (scaling from minimum takes seconds, not instant)
High Availability Configurations
RDS Multi-AZ (Instance)
- Synchronous standby in a different AZ — automatic failover
- Standby is not readable (unlike Aurora replicas)
- Use for: production databases that need simple HA without read scaling
RDS Multi-AZ (Cluster) — db.r6gd Only
- One writer + two readable standbys across 3 AZs
- Uses local NVMe + synchronous replication
- Sub-35-second failover
- Limited to specific instance classes
Aurora Multi-AZ
- Create at least one read replica in a different AZ for HA
- All replicas share storage, so failover has zero data loss
- For production: minimum 2 replicas across 2 AZs (writer + 2 readers = 3 AZs)
Aurora Global Database
- Cross-region replication with <1 second typical lag
- Managed RPO/RTO with automated failover
- Write forwarding lets readers in secondary regions redirect writes to the primary
- Use for: disaster recovery, low-latency global reads
RDS Proxy
- Fully managed connection pooler sitting between applications and the database
- Multiplexes thousands of application connections to a smaller pool of database connections
- Reduces failover time by maintaining open connections to standby
- Essential for Lambda → RDS/Aurora (Lambda creates many short-lived connections)
When to Use RDS Proxy
- Lambda functions connecting to RDS/Aurora (connection exhaustion risk)
- Applications with many short-lived connections
- Reducing failover disruption (proxy pins to new primary automatically)
When to Skip RDS Proxy
- Applications with persistent connection pools (like traditional app servers with HikariCP/pgBouncer)
- Workloads requiring session-level features (prepared statements, temp tables — proxy may pin connections)
Security
Encryption
- At rest: Enable at creation time (cannot be enabled later without snapshot-restore). Use AWS KMS CMK for key control.
- In transit: Enforce SSL via parameter group (
rds.force_ssl = 1for PostgreSQL,require_secure_transport = ONfor MySQL)
Network Isolation
- Deploy in private subnets only — never assign a public IP
- Use security groups to restrict ingress to application subnets
- Use VPC endpoints for API calls (
rdsandrds-dataendpoints)
Authentication
- IAM database authentication: Token-based, no passwords stored — good for Lambda and automated access
- Secrets Manager rotation: Automatic password rotation on a schedule — use for traditional username/password auth
- Kerberos/Active Directory: Available for SQL Server and Oracle via AWS Directory Service
Blue/Green Deployments
- Create a "green" copy of the production database with changes applied (engine upgrade, parameter changes, schema changes)
- RDS keeps the green environment in sync via logical replication
- Switchover takes ~1 minute with minimal downtime
- Automatic rollback if health checks fail
Supported Changes
- Major engine version upgrades
- Parameter group changes
- Schema changes on the green environment
- Instance class changes
Limitations
- Not available for Aurora Serverless v1 (v2 supported)
- Requires enough capacity for both environments during the transition
Backup and Recovery
Automated Backups
- Default retention: 7 days (configurable 0-35 days; 0 disables)
- Point-in-time recovery (PITR) to any second within the retention window
- Backups are stored in S3 (managed by AWS, not visible in your bucket)
Manual Snapshots
- Persist indefinitely until deleted
- Can be shared cross-account or copied cross-region
- Use for: pre-change safety nets, archival, cross-region DR
Aurora Backtrack (MySQL only)
- Rewind the database to a specific point in time without restore
- Operates on the same cluster — much faster than PITR
- Configure a backtrack window (up to 72 hours)
- Use for: recovering from bad queries, accidental deletes
Anti-Patterns
- Public subnets for databases. Never place RDS/Aurora in a public subnet. Use private subnets and access through application layer, VPN, or bastion.
- Default parameter groups. Always create custom parameter groups — default ones cannot be modified and make tuning impossible.
- Unencrypted instances. Encryption must be enabled at creation. Retrofitting requires snapshot → copy-encrypted → restore, which means downtime and new endpoints.
- Lambda without RDS Proxy. Lambda creates new connections per invocation. Without a connection pooler, concurrent Lambdas exhaust
max_connectionswithin seconds. - Single-AZ production databases. No HA means any AZ failure takes down the database until manual intervention.
- Oversized instances "just in case". Start with Performance Insights data, right-size based on actual db.load, not guesswork. Graviton (r7g) instances offer better price-performance.
- Ignoring storage IOPS limits. gp3 default is 3,000 IOPS — if the workload exceeds this, provision higher IOPS or move to io2 before hitting throttling.
- Manual password management. Use
--manage-master-user-password(Secrets Manager integration) or IAM authentication. Hardcoded passwords in application config are a security incident waiting to happen. - Not enabling deletion protection on production. A single
delete-db-instancecall without deletion protection can destroy the production database.
Migration Guidance
For migrating to RDS/Aurora, coordinate with the migration-advisor agent for full assessment workflows.
Common Migration Paths
- Self-managed MySQL/PostgreSQL → Aurora: Use AWS DMS for minimal-downtime migration with CDC
- Oracle/SQL Server → Aurora PostgreSQL: Use AWS SCT (Schema Conversion Tool) + DMS
- RDS MySQL → Aurora MySQL: Use snapshot restore (fastest) or create Aurora read replica of RDS instance then promote
Key Considerations
- Always run SCT assessment report before cross-engine migrations — it quantifies conversion effort
- Test with DMS validation tasks to verify data integrity post-migration
- Plan for endpoint changes — Aurora uses cluster endpoints (writer) and reader endpoints
Additional Resources
Reference Files
For detailed operational guidance, consult:
references/instance-sizing.md— Instance family comparison, Graviton recommendations, memory-to-connections ratios, ACU sizing, storage types, and cost optimization patternsreferences/parameter-tuning.md— PostgreSQL and MySQL parameter recommendations, Aurora-specific parameters, and safe change proceduresreferences/monitoring-operations.md— CloudWatch alarm thresholds, Performance Insights wait event analysis, Enhanced Monitoring, backup verification, failover testing, connection diagnostics, and common CLI commands
Related Skills
migration-advisor(agent) — Full migration assessment workflows (DMS, SCT, migration waves)cost-check— Detailed cost analysis and Reserved Instance recommendationssecurity-review— IAM, network, and encryption audit for database configurationsnetworking— VPC design, subnet planning, and security group configuration
Output Format
When recommending a database design, include:
| Component | Choice | Rationale |
|---|---|---|
| Engine | Aurora PostgreSQL 16.4 | Wire-compatible, storage auto-scaling |
| Writer | db.r7g.xlarge (provisioned) | Consistent write load, 4 vCPU / 32 GiB |
| Reader(s) | db.serverless (Serverless v2, 1-16 ACU) | Variable read traffic |
| HA | Multi-AZ (writer + 2 readers across 3 AZs) | Production requirement |
| Proxy | RDS Proxy | Lambda consumers |
| Encryption | KMS CMK, force SSL | Compliance requirement |
Include estimated monthly cost range using the cost-check skill.
原文・著作権は Anthropic および各プラグイン作者に帰属します。日本語訳は Claude API による自動翻訳です。