Please enable JavaScript.
Coggle requires JavaScript to display documents.
Database - Coggle Diagram
SQL
Relational Database System (RDS)
- AWS managed SQL databases
- PostgreSQL, MySQL, MariaDB, MSSQL
Replication
Multi-AZ
- Active/Passive replication
- Passive RDS is standby instance and wait to take over in case of failure
Failover Setup
- In a typical scenario, either health check (EC2 instance must support it) or CW Alarm can be used
- If failure is detected, Lambda function is triggered to update the Route 53 and promote passive replication to be active
- This is already built-in to Multi-AZ setting so not required unless necessary
Read Replicas
- Highly available setting that is eventually consistent
- Can be deployed cross-region
Distributed Reads
- Route 53's weighted query can be used to split the database traffic to the read replicas
Cross-Region
- Supported for some RDS
- Not supported if encrypted
Types
Oracle
- Transparent Data Encryption (encrypt before write)
RDS Backup
- Can create a backup and restore as a new RDS instance
Recovery Manager (RMAN)
- Backup and restore to non-RDS Oracle DB
- RMAN stores the backup in the S3 bucket
Real Application Clusters
- RDS do not support RAC
- Dedicated EC2 instance, however, can be used to support it
MySQL
RDS Backup
- use
mysqldump
command to export and import it to the new instance
- Necessary step to create a replica
RDS Proxy
- A proxy stands between AWS services and the RDS databases
- Preventing "TooManyConnections" by re-using he connection with connection pool
-
Aurora
- PostgreSQL/MySQL compatible automatic database scaling solution
- Storage volume is shared among master and every replicas
Availability
- Replicas can be distributed across region, and one of the replica can quickly take over if the master fails
Aurora Cluster
- The group of master and replicas
- Writer endpoint and reader endpoint is provided
Endpoints
Cluster(Writer) Endpoint
- Connects to the master (or backup write replica if master failed)
- Writes to the shared storage
Reader Endpoint
- Read-only endpoint where the ingress is equally distributed to all available replicas
Custom Endpoint
- Connects to the subset of replicas pre-defined by user
- Useful to connect to higher performance instances for CPU intensive analytical queries
Instance Endpoint
- Connect directly to a specific instance
- Mostly for diagnosis and fine-tuning
-
-
Managed Planned Failover
- Special feature to perform failover manually in a managed way
- Primary instance is gracefully put to offline, and the secondary instance take over
Aurora Serverless
- On-demand, autoscaling configuration of Aurora
- Automatically provision instances and pay per seconds used
Data API
- Application can directly connect to Aurora
- Secrets Manager decides whether the connection is allowed or denied
RDS Proxy for Aurora
- RDS proxy can be configured to connect to cluster endpoint
- Can also create a read-only version, where it connects to the reader endpoint
Global Aurora
- Cross-region Active/Active replication of the entire Aurora
- High availability and supports disaster recovery
Write Forwarding
- Writes to any secondary cluster is forwarded to the primary cluster
- Secondary cluster is then updated by data replication
NoSQL
columns
Attributes
- Any other columns than the key
- Can freely store all supported types of data
Sort Key
- Used along with Partition Key, forms a primary key
- Combination with Partition Key must be unique, yet partition key do not have to be unique anymore
Partition Key
- Unique identifier for each row
Index
- Boost query speed by indexing data
- Using some extra space
Local Secondary Index (LSI)
- Partial (or full) projection (image) of the original table
- Alternative sort key can be set to query the data against different dimension
Global Secondary Index (GSI)
- Not only the sort key, but an alternative partition key can be set
- Can be created only after the table creation
Global Tables
- Multi-active replicas across regions
- Eventually consistent. Data has to be idempotent to be consistent
TTL
- Retention period can be applied to the rows
- The table must have a column with UNIX epoch time format
Adaptive Capacity
- Automatic adjustment of read/write capacity
- Credit is accumulated for unit of read/write that hasn't' utilized, and it's redeemed when there is a high demand
- Enabled by default
DocumentDB
- AWS managed MongoDB
- Scale and managed similar to Aurora
Amazon Timestream
- Special database dedicated for time series data
- Recent data is stored in memory
- Historical/long data is automatically transferred to cost-optimized storage
- Can handle high volume of data (> hundreds terabytes)
- Supports SQL-like query, yet the underlying data structure is not RDBMS and optimized to handle time stream better