Section9: AWS Fundamentals:RDS + Aurora + ElastiCache Flashcards
What RDS database do you get in AWS?
- Postgres
- MySQL
- MariaDB
- Oracle
- Microsoft SQL Server
- Aurora
Mention a few things regarding RDS Read Replicas for read scalabilities
- Up to 5 read replicas
- Within ZA,Cross AZ or Cross Region
- Replication is ASYNC, so reads are eventually consistent.
- Replicas can be promoted to their own DB.
- Applications must update the connection string to leverage read replicas.
What happens when you change your RDS from a Single-AZ to Multi-AZ?
- Note: Zero downtime operation
- The following will happen internally:
-> A snapshot is taken
-> A new DB is restored from the snapshot in a new AZ
-> Synchronization is established between the two databases.
Describe Amazon Aurora
- Aurora is a proprietary technology from AWS(not open source)
- Postgres and MySQL are both supported as Aurora DB
- Aurora is “AWS cloud optimized” and claims 5x performance improvement over MySQL and Postgres.
- Aurora storage automatically grows in increments of 10Gig, up to 128 TB.
- Aurora can have 15 replicas while MySQL has 5
- Failover in Aurora is instantaneous.
- Aurora cost more than RDS(20% more).
Aurora High Availability and Read Scaling
1) 6 copies of your data across 3 AZ:
- 4 copies out of 6 needed for writes
- 3 copies out of 6 need for read
- Self healing
- Storage is striped across 100s volumes
2) One Aurora Instance takes writes(master)
3) Automated failover for master in less than 30 seconds
4) Support for Cross Region Replication
ElastiCache - Redis vs Memcached
Redis:
- Multi AZ with Auto-Failover
- Read Replicas to scale reads and have high availability
- Data Durability using AOF persistence
- Backup and restore features
Memcached:
- Multi-node for portioning of data
- No high availability
- Non persistent
- No backup and restore
- Multi-thread architecture
ElastiCache - Cache Security
1) All caches in ElastiCache:
- Do not support IAM authentication
- IAM policies on ElastiCache are only used for AWS API-level security
2) Redis AUTH
- You can set a “Password/token” when you create a Redis cluster
-Support SSL in flight encryption
3) Memcached
- Supports SASL-based authentication
3 Patterns for ElastiCache
1) Lazy loading: all the read data is cached, data can become stale in cache.
2) Write Through: Adds or update data in the cache when written to a DB(no stale data)
3) Session Store: Store temporary session data in a cache(using TTL features)
ElastiCache - Redis Use Case
- Gaming Leaderboards are computationally complex
- Redis Sorted sets guarantee both uniqueness and element ordering
- Each time a new element added, its ranked in real time, then added in correct order.
Importane Ports to remember
- FTP:21
- SSH:22
- SFTP:22
- HTTP80
- HTTPS:443
- PostgreSQL:5432
- MySQL:3306