DEV Community

Cover image for AWS Managed PostgreSQL on AWS (RDS & Aurora): A Comprehensive Guide from My Notes
Md Enayetur Rahman
Md Enayetur Rahman

Posted on

AWS Managed PostgreSQL on AWS (RDS & Aurora): A Comprehensive Guide from My Notes

I recently completed the course “Introduction to Managed PostgreSQL offerings on AWS.” While studying, I took careful notes. I’m sharing those notes below as a complete, practical blog so others can benefit from a single place that summarizes what matters—and what to keep in mind—when choosing between Amazon RDS for PostgreSQL and Amazon Aurora (PostgreSQL‑compatible).


Why this post?

If you’re evaluating PostgreSQL in AWS, the options can feel overwhelming: self‑managed on EC2, RDS for PostgreSQL, Aurora PostgreSQL‑compatible, plus serverless, Global Database, Limitless, Blue/Green, Zero‑ETL and more. This guide distills the course content into a structured, actionable reference you can keep handy for design decisions, migrations, and day‑to‑day operations.


1) PostgreSQL Fundamentals (What & Why)

What is PostgreSQL?

An open‑source, object‑relational database (ORDBMS) with enterprise‑grade features and ANSI/ISO SQL compliance.

Key strengths

  • Open source, license‑free: No audits/fees; community‑driven, not controlled by a single vendor.
  • Relational core + object‑oriented features: Tables/rows/columns + inheritance, encapsulation, polymorphism for richer modeling.
  • Advanced data types: Geospatial (PostGIS), JSON/JSONB, and vector types for LLM/AI use cases.
  • Reliability & performance: Robust, standards‑aligned, and highly extensible.

Versioning & release cadence

  • History: Originated at UC Berkeley (1986); continuous community development.
  • Version scheme: Since PostgreSQL 10, two‑part versioning MAJOR.MINOR (e.g., 17.3). Prior to 10, three‑part (e.g., 9.6.24).
  • Support window: Community typically supports a major version for ~5 years.

2) Ways to Run PostgreSQL on AWS

A. Self‑Managed PostgreSQL

  • You own install/config/patching/HA/backup/scaling.
  • Runs on your hardware or EC2.
  • Pros: Full control & customization.
  • Cons: Higher ops burden; requires mature DBA/SRE practices.

B. Fully Managed PostgreSQL

  • Amazon RDS for PostgreSQL and Amazon Aurora (PostgreSQL‑compatible).
  • AWS operates the fleet; you focus on schema, queries, and application logic.

Common theme: Both expose PostgreSQL compatibility, so existing apps/tools typically work unchanged.


3) Why Move to Managed

Primary benefits

  1. Efficiency via automation: Patching, backups, monitoring, failover, scaling → fewer risks/human errors.
  2. Cost optimization: Scale to demand (e.g., Aurora Serverless v2); avoid peak over‑provisioning.
  3. Focus: Free DBAs/devs to build features rather than maintaining infrastructure.

Operational conveniences

  • Preconfigured parameters by instance class.
  • CloudWatch metrics; 40+ DB event subscriptions.
  • Automatic updates within maintenance windows.

4) Amazon RDS (Relational Database Service)

What RDS provides

  • Easier setup, operation, and scaling of relational databases.
  • Automates hardware provisioning, DB setup, backups, patching.
  • Engines: PostgreSQL, MySQL, MariaDB, SQL Server, Oracle, DB2 (as presented).

Open‑source engines on RDS

  • Fully managed PostgreSQL/MySQL/MariaDB; stay current on versions and leverage AWS hardware generations (e.g., Graviton).
  • Multi‑AZ cluster architectures target faster failover (course mentioned under ~35s).

Migration paths into RDS

  • AWS DMS (Database Migration Service) and AWS SCT (Schema Conversion Tool) for heterogeneous migrations and CDC.

RDS automates vs. you own

  • AWS: Automatic failover, backups & recovery, DB upgrades, isolation/security primitives, compliance, push‑button scaling, patching, advanced monitoring, routine maintenance.
  • You: Schema design, query construction, tuning.

5) RDS for PostgreSQL — Highlights & Limits

PostgreSQL versions (as presented)

  • Support spanning v13 → v17 in the course.

Extensions & features

  • PostGIS (spatial), Full‑Text Search, JSON/JSONB, etc.

Scaling

  • Compute: 25+ instance types; scale up/down (often minimal/no downtime).
  • Headroom (as presented): up to 128 vCPU and 4 TB RAM.
  • Storage: Grow elastically without downtime.
  • Use cases: spikes, dev/test cost control, steady growth.

High Availability

  • Multi‑AZ options: 1) One standby (classic). 2) Two readable standbys → lower commit latency, faster failover, and two read secondaries.
  • Read replicas: Offload reads; cross‑Region options for locality & DR.

Backups & Recovery

  • Automated backups: Daily snapshot + WAL logs every ~5 min to S3; retention 1–35 days; Point‑in‑Time Recovery (PITR).
  • Manual snapshots: On‑demand; retained until you delete; ideal for long‑term checkpoints and pre‑change safety.

Monitoring

  • CloudWatch CPU, memory, storage, IOPS, connections, etc.; dashboards & alarms.
  • Enhanced Monitoring for OS/process‑level insights.
  • Performance Insights for workload & analysis, bottleneck identification, tuning guidance.

Security & Compliance

  • VPC Security Groups for network isolation.
  • Encryption: KMS at‑rest, TLS in‑transit.
  • IAM for admin/API access control.
  • Directory/Kerberos integration for centralized auth.
  • Compliance: e.g., HIPAA eligibility under BAA; shared responsibility applies.

6) Amazon Aurora (PostgreSQL‑Compatible)

Positioning

  • Cloud‑native, re‑engineered storage/compute architecture;PostgreSQL‑compatible wire/protocol and features.

Headline benefits

  • Performance: Up to throughput vs. standard PostgreSQL (as presented).
  • Scale: Up to 15 read replicas.
  • Availability: 99.99% target with 6‑way replicated storage across 3 AZs.
  • Cost: Around 1/10 of commercial DBs.

Ecosystem & integrations

  • Deep AWS integrations: Lambda, CloudTrail, S3, IAM, etc.

Primary use cases

  1. Migrate to managed with enterprise features.
  2. Enterprise & SaaS (CRM/ERP, mission‑critical).
  3. Global deployments (multi‑Region low‑latency reads).
  4. Serverless operations (pay‑per‑use, instant scale).

7) Aurora PostgreSQL‑Compatible — Feature Deep‑Dive

Aurora Serverless v2

  • Instant, fine‑grained autoscaling to very high TPS in fractions of a second.
  • No instance management; pay for capacity consumed.
  • Full Aurora features (e.g., Global Database).
  • Potentially large cost reduction vs. peak provisioning (course cites up to ~90% in some scenarios).

Aurora Global Database

  • One primary Region for writes + up to 5 secondary read‑only Regions.
  • Replication at the storage layer (not SQL), typically sub‑second lag (distance dependent).
  • Benefits: local low‑latency reads, cross‑Region DR.

Aurora Limitless Database

  • Horizontally scale beyond single‑instance write/storage limits.
  • Distributed query planning & transaction management provided by Aurora.
  • Target millions of writes/sec, petabyte‑scale data, still a single logical database.

Fast, space‑efficient cloning

  • Clone multi‑TB clusters in minutes for dev/test/upgrades/analytics; pay only for delta blocks.

Aurora I/O‑Optimized

  • Predictable pricing (no per‑request I/O charges).
  • Up to ~40% savings for I/O‑intensive workloads (as presented).
  • Performance boosts (throughput/latency) plus Optimized Reads for large working sets.

Blue/Green Deployments (Aurora/RDS compatible)

  • Safer, faster updates with zero data loss.
  • Maintains a synchronized staging (green) environment; guardrails for switchover.

Vector search in Aurora PostgreSQL

  • Store billions of embeddings; native high‑performance vector indexes for similarity search; convenient for GenAI apps.

Zero‑ETL to Amazon Redshift

  • Near real‑time Aurora transactional data in Redshift without building ETL pipelines.
  • Consolidate from multiple Aurora clusters; enable operational analytics/ML quickly.

8) Migration Options to Managed PostgreSQL on AWS

  • Self‑service tools: AWS SCT (schema conversion), AWS DMS (data migration/CDC).
  • Fixed‑price migration programs (specialized).
  • AWS Professional Services and AWS Partners for complex/legacy migrations.

Typical migration flow

1) Assess source/targets, extensions, HA/perf needs.

2) Convert schema (SCT), remediate incompatibilities.

3) Load baseline data; enable CDC (DMS).

4) Dual‑run validation & performance tests.

5) Cutover during maintenance window.

6) Post‑cutover monitoring & tuning.


9) RDS vs. Aurora — Quick Decision Guide

Choose RDS for PostgreSQL if

  • You want vanilla PostgreSQL with familiar extensions/behavior.
  • Workloads are steady‑state; Multi‑AZ + read replicas meet HA/read‑scale needs.
  • You don’t need Aurora‑specific features (Global DB, Limitless, Serverless v2, fast storage‑layer cloning).

Choose Aurora PostgreSQL‑Compatible if

  • You need higher throughput/availability and faster read scale‑out.
  • You require global reads/DR (Global Database) or serverless elasticity.
  • You anticipate very large scale (write throughput/petabytes) → Limitless.
  • You want fast cloning, I/O‑Optimized pricing, or Zero‑ETL analytics with Redshift.

Both provide encryption, VPC isolation, IAM integration, backups, monitoring, and automation.


10) Configuration & Operations Checklist

High Availability & DR

  • Choose Multi‑AZ flavor (1 standby vs. 2 readable standbys).
  • Add read replicas for read scaling and/or cross‑Region DR.
  • For global reads/DR → Aurora Global Database.

Backups/Recovery

  • Set automated backup window and retention (1–35 days).
  • Understand PITR (5‑min log granularity).
  • Use manual snapshots for long‑term or pre‑change checkpoints.

Scaling

  • Right‑size instance class & storage; monitor utilization.
  • For spiky/variable traffic: consider Aurora Serverless v2.
  • Plan vertical vs. horizontal read scaling (replicas).

Monitoring

  • Build CloudWatch dashboards & alarms (CPU, memory, storage, IOPS, connections, replica lag).
  • Enable Enhanced Monitoring for OS‑level signals when needed.
  • Use Performance Insights to profile SQL load and fix top wait events/queries.

Security

  • Isolate in VPC; restrict SG inbound to app tiers/jump hosts.
  • Enforce TLS in‑transit; KMS at‑rest.
  • Govern access with IAM & (optionally) Directory integration.
  • Map responsibilities under shared responsibility model for compliance.

Maintenance

  • Define maintenance windows for minor upgrades/patches.
  • For prod updates, prefer Blue/Green deployments.
  • Keep engines within supported ranges (course noted RDS PG 13–17).

Cost hygiene

  • Avoid over‑provisioning; use autoscaling where appropriate.
  • Evaluate Aurora I/O‑Optimized for I/O‑heavy workloads.
  • Dev/test: smaller classes or serverless; stop non‑essential environments (where supported).

Feature leverage

  • Use extensions (e.g., PostGIS) judiciously; ensure support on target engine.
  • For AI/LLM: consider vector support if similarity search is needed.
  • For analytics: evaluate Zero‑ETL to Redshift.

11) At‑a‑Glance Matrix

Capability RDS for PostgreSQL Aurora PostgreSQL‑Compatible
Engine Community PostgreSQL PostgreSQL‑compatible (Aurora storage/compute)
Perf (course) Solid Up to standard PG throughput
HA Multi‑AZ (1 standby or 2 readable) Multi‑AZ with 6‑way replicated storage
Read scale Read replicas (incl. cross‑Region) Up to 15 replicas; Global Database
Serverless Aurora Serverless v2
Horizontal write scale Aurora Limitless (single logical DB)
Backups Automated (1–35d) + snapshots; PITR (5‑min logs) Same concepts; storage‑layer efficiencies
Blue/Green Yes (RDS Blue/Green deployments) Yes (compatible)
Vector index/search Limited via extensions Native vector capabilities highlighted
Zero‑ETL to Redshift Not native Native Zero‑ETL integration
Cost model Instance + storage + I/O Instance/Serverless; I/O‑Optimized option

12) Quick Reference Numbers (from the course)

  • RDS PostgreSQL support: v13–v17.
  • RDS scale envelope (as presented): up to 128 vCPU / 4 TB RAM; 25+ instance types.
  • Backups: automated retention 1–35 days; logs every ~5 minutes to S3 for PITR.
  • Multi‑AZ (2 readable standbys): faster commits/failover + two read secondaries.
  • RDS failover target (as mentioned): < ~35 seconds.
  • Aurora read replicas: up to 15.
  • Aurora availability target: 99.99%.
  • Aurora Global DB: primary + up to 5 secondary Regions; typical sub‑second lag (distance dependent).
  • Aurora Serverless v2: instant, fine‑grained scaling; pay per use; potential ~up to 90% cost reduction vs. peak provisioning scenarios.
  • Aurora I/O‑Optimized: potential ~up to 40% savings for I/O‑intensive workloads.

Note: These figures reflect the statements from the course and may vary by Region/engine version—always check current AWS documentation for exact limits & pricing before production decisions.


13) Practical “What to Decide Upfront”

  1. RDS vs. Aurora: Throughput/latency targets, global read needs, serverless elasticity, future horizontal scale.
  2. Availability: Multi‑AZ flavor; RTO/RPO targets; cross‑Region replicas or Global DB.
  3. Backup policy: Retention, snapshot cadence, PITR objectives, backup windows.
  4. Scale strategy: Instance classes, read replicas, or serverless; headroom for spikes.
  5. Security: VPC/Security Groups, TLS policy, KMS keys, IAM roles, directory integration.
  6. Monitoring: CloudWatch alarms, Performance Insights retention, baseline SLOs.
  7. Maintenance & upgrades: Windows, Blue/Green plan, version roadmap (stay within support).
  8. Extensions/features: PostGIS/JSON/Vector; compatibility checks.
  9. Analytics: Need for Zero‑ETL → Redshift; data gravity & latency.
  10. Migration: DMS/SCT approach, dual‑run validation, cutover procedure.

Conclusion

I put this guide together after completing the AWS course so I—and you—have one practical reference for making better PostgreSQL decisions on AWS. If you need “standard PostgreSQL” with minimal ops overhead, RDS for PostgreSQL is a great default. If you anticipate global scale, spiky traffic, or very high throughput, Aurora PostgreSQL‑compatible (with Serverless v2, Global Database, Limitless, and Zero‑ETL) offers powerful levers without managing the underlying plumbing.

If this was helpful, feel free to share it with your team and bookmark it for architecture reviews and migrations.

Top comments (0)