RDS
-
Relational Database Service
AWS SaaS for managing relational databases
-
Traditionally, when setting up a database server the following things need to be considers
- Software Updates
- Performance
- Backups
- Database Admin
-
RDS manages database instances in AWS running on EC2
RDS managed task examples:
- Software upgrades
- Nightly database backups
- Monitoring
-
RDS Instance Architecture
- EC2 Instance wrapper
- Instance Type will impact performance
- Can be changed after creation (not recommended)
- Operating System
- Database Type
- Instance Type will impact performance
-
RDS Backups
- Occurs daily
- Configurable backup window
- Backups stored 1 - 35 days
- Restore database from backup
-
Multi-AZ Deployment
- Database replication to defferent Availability Zone
- Automatic failover in case of catastrophic event
-
Database Read Replica
- Non-production copy of database
- Eventual consistency with source
- Useful for running queries on data
- Will not be used as failover
-
Choosing a Databse Engine
-
Available Database Options
- MySQL
- PostgreSQL
- Microsoft SQL Server
- MariaDb
- Oracle Database
- Amazon Aurora
-
These databases are offered at different cost.
-
What database type are you using in development/locally?
-
How much do you want to spend?
-
What database type do you have the most experience with?
-
What database client do you like the most?
-
Creating a database in RDS
Use the AWS Web Console to create and manage databases
-
Connect to RDS Database with AWS-CLI
Access RDS
aws rds <<command>>
-
Connect to RDS Database with Python/BOTO3
import boto3
client = boto3.client('rds')
-
AWS-CLI and BOTO3 are good for managing the RDMS but are not very useful for dealing with databases directly. For this we will use python tools that are designed specificly for interacting with a database
-
Popular libraries for accessing databases
- SQLAlchemy
- Records
- PugSQL
- Django ORM
- peewee
- PonyORM
- SQLObject