Running Production PostgreSQL Databases On Amazon RDS For PostgreSQL
Running Production PostgreSQL Databases On Amazon RDS For PostgreSQL
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Learning Objectives
and monitoring
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Virtual Workshop Instructions
1. Use your personal or test AWS Account
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Introduction
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Amazon RDS
Managed relational database service with a choice of six popular
database engines
Amazon Aurora
Easy to Secure & Available & Performant &
administer compliant durable scalable
Easily deploy and Data encryption at rest Automatic Multi-AZ Scale compute
maintain hardware, OS and in transit; industry data replication; and storage with a few
and DB software; built- compliance and automated backup, clicks; minimal downtime
in monitoring assurance programs snapshots, failover for your application
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Amazon RDS - fully managed
Spend time innovating & building new apps, not managing infrastructure
Automatic fail-over
Backup & recovery
Isolation & security
Schema design Industry compliance
You AWS Push-button scaling
Query construction
Query optimization Automated patching &
upgrades
Advanced monitoring
Routine maintenance
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Move to managed relational databases
Migrate on-premises or cloud-hosted relational databases to managed services
Amazon Aurora
MySQL, PostgreSQL
Amazon RDS
MySQL, PostgreSQL, MariaDB,
Oracle, SQL Server
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Hundreds of thousands of customers use Amazon RDS
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
PostgreSQL fast facts
Open-source database
In active development for 20+ years
Owned by a foundation, not a single company
Permissive, innovation-friendly open source license
High performance out of the box
Object-oriented and ANSI-SQL:2008 compatible
Most geospatial features of any open source database
Supports stored procedures in 12 languages (Java, Perl,
Open Source Initiative
Python, Ruby, Tcl, C/C++, its own Oracle-like PL/pgSQL,
etc.)
Most Oracle-compatible open-source database
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Customer Credentials
"RDS for PostgreSQL solves one of the biggest operational overheads
we have dealt with since the inception of our company. We have
spent countless hours setting up, backing up, replicating, restoring,
replacing, scaling, swapping, and tuning our PostgreSQL databases”.
- Mark Corner, CTO
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Regions and Availability Zones
AWS Cloud
Region
Availability Zone C
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Amazon RDS for PostgreSQL
• PostgreSQL community version
with easy configuration and Region
management Applications
• Supports 9.4, 9.5, 9.6, 10, 11,12 Availability Zone 1 Availability Zone 2
“Application
TCP 5432
security group”
VPC
Application tier
Amazon RDS
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Amazon RDS for PostgreSQL: Instance types
T family R family M family
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
High-performance database storage
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
High Availability
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
RDS Multi-AZ
Region
• Fully managed secondary
Availability zone A Availability zone B
in-region
• Distinct EC2 and EBS S
M S
M
resources DB instance
Instance DB Instance
instance
standby standby
• Synchronous storage
replication
• Failover in 1-2 minutes Volume Volume
• Crash recovery
• CNAME propagation
RDS monitoring and automation
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Scale
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Performance Factors
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Scale compute and storage with ease
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Scale for read workloads
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Backup
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
RDS backups
Region
Automated backups
Availability zone A Availability zone B
• Daily snapshot during backup
window
• Transaction logs to S3 every 5 DB Instance DB instance
minutes standby
Manual backups
• Take a snapshot any time EBS
snapshot
Transaction logs (5
• Kept until you delete minutes) (daily)
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
RDS Snapshots • Always incremental
• Amazon S3 99.999999999%
durability
• Supports encryption
Amazon EBS • Copy across accounts, across
volume regions
Amazon S3
A B C C1 D B1 E
A B A C1 D
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Restore from snapshot
• Restore from any snapshot
• Copy snapshots to other
regions or accounts Original
instance
RestoreDBInstance
Refresh test environments FromDBSnapshot
Test upgrades
Instantiate logical replicas Snapshot New instance
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Restore to a point in time
• Restore to any second in
backup retention
• Available in-region/account Original
instance
• Latest restorable time
typically <5 minutes
RestoreDBInstance
ToPointInTime
Oops… I dropped a table
Recover from application Snapshot New instance
errors or logical corruption
Transaction logs
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Security
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
RDS Access Control at a Glance
Access control at DB level Controlled with IAM Network Security
Private subnet
Security group
Applications Users and DBA and ACLs
Amazon RDS
Amazon RDS
subnets
• Control egress when using
outbound network access
(dblinks, postgres_fdw)
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Data Encryption
Encryption at Rest Encryption in Transit
An SSL certificate is available on RDS
AWS Key Management
instances
Service • Used to encrypt network traffic
• Also used to verify the endpoint
to guard against spoofing
• Storage encryption with attacks
Amazon KMS integration
• Manage/bring your own keys
By default, SSL is optional
• Enable when creating instance
• Set rds.force_ssl to 1 to force
• Encrypt existing snapshots and SSL
restore as encrypted instances
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Monitoring
Enhanced monitoring for Amazon RDS
• Access to over 50 CPU, memory, file Enhanced
Monitoring
system, and disk I/O metrics
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
RDS Features
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Transportable databases
Region
Fast method of data export and import Availability zone A Availability zone B
DB1
Supported on RDS PostgreSQL versions
11.5 and 10.10 onwards
Availability zone A
Availability zone B
• Files containing JSON documents need
to be regularly loaded from an
Amazon Simple Storage Service (S3)
bucket
Primary Standby
• Users need to run queries on the
documents, along with other
transactional data
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Q&A
[email protected]
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
[email protected]
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Join us for the Next session!!
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.