1 / 10

🗄️ AWS Database Services

Explore the different database options available on AWS

🎯 What You'll Learn Today:

• Why we need databases beyond simple storage

• Relational vs. NoSQL databases

• Amazon RDS and Aurora

• Amazon DynamoDB and DAX

• Amazon ElastiCache and Redshift

🏢 Think of Databases like a Library System

Just like a library organizes books with catalogs, indexes, and structured sections, databases organize data for efficient storage, retrieval, and management!

📊 Introduction to Databases

Why Use Databases?

• Storing data on disk (EFS, EBS, EC2, S3) has limitations

• Databases provide structured data storage

• Enable efficient querying and indexing

• Optimized for specific purposes with different features and constraints

📋 Excel vs. Database

While Excel is great for small datasets, databases handle massive amounts of data with better performance, security, and concurrent access capabilities.

📈 Relational Databases

Relational databases organize data into tables with rows and columns, similar to Excel spreadsheets.

SQL Language

Uses Structured Query Language (SQL) to perform queries and lookups

Relationships

Tables can be related to each other through keys

Structured Data

Data follows a predefined schema

Example Tables:

roll no Name Class
1 Yash 2nd year
2 Vikram Completed
course name
bsc yash
bca vikram

📝 NoSQL Databases

NoSQL (non-SQL/non-relational) databases provide flexible data models for modern applications.

Flexibility

Easy to evolve data models as requirements change

Scalability

Designed to scale-out using distributed clusters

High Performance

Optimized for specific data models and access patterns

JSON Data Example:

{ "name": "Harsh", "age": "23", "cars": [ "BMW", "Audi", "Benz" ], "address": { "type": "house", "number": "31", "street": "Dream Road" } }

☁️ Databases on AWS

AWS offers managed database services that handle the heavy lifting of database administration.

Benefits of AWS Managed Databases:

• Quick provisioning

• High availability built-in

• Vertical and horizontal scaling

• Automated backups and restore

• Automated upgrades and OS patching

🚗 Self-Managed vs. Managed

Running databases on EC2 is like maintaining your own car - you handle all repairs and maintenance. AWS managed databases are like using a car service - they handle everything for you!

Note: You could run database technologies on EC2, but you must handle backup, patching, high availability, fault tolerance, and scaling yourself.

🗃️ Amazon RDS Overview

Amazon Relational Database Service (RDS) makes it easy to set up, operate, and scale relational databases in the cloud.

Supported Database Engines:

• PostgreSQL

• MySQL

• MariaDB

• Oracle

• Microsoft SQL Server

• Aurora (AWS Proprietary database)

🔒 Security Note

You cannot SSH into RDS instances. AWS manages the underlying infrastructure for you.

RDS Architecture:

📊 → 🔄 → 📊

Primary DB Instance → Synchronous Replication → Standby Replicas

🚀 Amazon Aurora

Aurora is AWS's proprietary high-performance relational database engine.

Performance

5x performance improvement over MySQL, 3x over PostgreSQL

Scalability

Storage automatically grows in 10GB increments up to 128TB

Cost Effective

Pay per second, 20% more than RDS but more efficient

Key Features:

• Compatible with PostgreSQL and MySQL

• Highly available and durable by design

• Serverless option available

• Continuous backup to S3

⚡ Amazon ElastiCache Overview

ElastiCache provides fully managed Redis and Memcached in-memory data stores.

🧠 In-Memory Databases

Think of ElastiCache as your application's short-term memory - extremely fast but volatile, perfect for caching frequently accessed data.

Benefits:

• Reduces load off databases for read-intensive workloads

• High performance and low latency

• AWS handles OS patching, optimizations, setup, monitoring

• Automatic failure recovery and backups

ElastiCache Architecture:

👥 → ⚡ → 💾

Users → ElastiCache (Cache) → Database (Persistence)

📦 Amazon DynamoDB

DynamoDB is AWS's flagship fully managed NoSQL database service.

Scalability

Scales to massive workloads, millions of requests per second

Performance

Single-digit millisecond latency

Serverless

No servers to provision or manage

Key Features:

• Fully managed with replication across 3 AZs

• Integrated with IAM for security and administration

• Key/Value and document data models

• Auto-scaling capacity

📋 DynamoDB Practical

Create tables without database, use partition keys like user_id, and store all data in a single table (no relationships like in RDS).

🚀 DynamoDB Accelerator & Redshift

DAX

Fully managed in-memory cache for DynamoDB

10x performance improvement

Secure, highly available, and scalable

Redshift

Data warehousing for analytics

Based on PostgreSQL but for OLAP

Columnar storage for better analytics performance

Redshift Serverless

Automatically provisions and scales

Run analytics without managing infrastructure

Pay only for what you use

DAX vs ElastiCache:

• DAX is specifically for DynamoDB only

• ElastiCache can be used with various databases

• Architecture: User → DAX → DynamoDB Tables

Redshift Use Case:

Perfect for business intelligence, analytics, and data warehousing where you load data periodically (e.g., every hour) rather than continuously.

📚 Summary & Key Takeaways

🎯 What We Learned:

Databases provide structured data storage beyond simple file systems

Relational databases use tables and SQL (RDS, Aurora)

NoSQL databases offer flexibility and scalability (DynamoDB)

In-memory databases provide caching for performance (ElastiCache, DAX)

Data warehousing enables analytics (Redshift)

🧠 Choosing the Right Database

Structured data with relationships → RDS/Aurora
Flexible schema, high scale → DynamoDB
Caching needs → ElastiCache/DAX
Analytics and reporting → Redshift

🚀 Next Steps:

1. Experiment with creating different database types
2. Try the DynamoDB practical exercise
3. Compare performance between different options
4. Explore how databases integrate with other AWS services!

💪 Remember: Each database service is optimized for specific use cases. Understanding their strengths will help you choose the right tool for your application needs!