Summary: https://www.udemy.com/course/aws-certified-cloud-practitioner-new/learn/lecture/20260728
Databases 101
Ref: https://www.udemy.com/course/aws-certified-cloud-practitioner-new/learn/lecture/20118314
- DBs allow you to give some structure to your stored data, making it easily searchable/queryable
- Define schemas, indexes, and relationships in your dataset
- 💡 Like taking a raw text and creating a table of contents, numbered pages, highlighting sections, marking pages, taking notes… makes it easier to find stuff!
Relational Databases = SQL Databases = Relational DB Management Systems (RDBMS)
- đź”§ Rigid schemas and tables, defined rows (items) and columns (attributes)
- Can use SQL (Structured Query Language) to query tables
- Relational tables are very similar to Excel spreadsheets, with links between them!
- Examples
- Open source: MySQL, PostgreSQL, MariaDB…
- Proprietary: Oracle SQL, Microsoft SQL Server…
- Two main optimization types
- Row-based = OLTP (OnLine Transactional Processing) → optimized for transactions
- e.g. Amazon RDS, Amazon Aurora
- Column-based = OLAP (OnLine Analytical Processing) → optimized for analytics
Non-relational Databases = NoSQL Databases
- đź”§ Less rigid, more flexible schemas
- ‼️ Can NOT use pure SQL!! (some NoSQL DBs can use SQL-like languages)
- âť— Scale better than SQL DBs (but have less consistency)
- Examples
- Document DBs (e.g. MongoDB)
- Can for example store documents in JSON format
- Graph DBs (e.g. Amazon Neptune)
- key-value DBs (e.g. Amazon DynamoDB)
- Example of DDB table (Primary Key + Attributes)
- …
Databases in AWS
- Can always run DB programs/SW inside an EC2 instance…
- âť— But you have to manage that instance! It's usually a lot of admin overhead!
- Recommended: use AWS-managed DB services
- 👍 Quick provisioning, HA, vertical/horizontal scaling
- 👍 Automated backups/restores
- 👍 Patches & updates handled by AWS
- 👍 Easy integrations with monitoring, alerting, and other AWS services
- 👎 Less control than your own, managed DB
AWS SQL Database Services
- Amazon RDS (Relational Database Service):
- Row-based, OLTP, free-tier eligible
- Private service → deploys RDS instances in your VPC, which host a SQL engine of your choice (PostgreSQL, MariaDB…)
- Optional features:
- Read Replicas (RRs) → allow for Read scalability (can read from more than one instance, distributes Read operations across many instances)
- Multi-AZ deployments → allow quick failover to a different AZ → HA