AWS Aurora

What is Aurora
- Amazon Aurora is a MySQL and PostgreSQL-compatible relational database engine.
- Amazon Aurora provides up to five times better performance than MySQL and three times better than PostgreSQL databases at a much lower price point, whilst delivering similar performance and availability.
- Amazon Aurora typically involves a cluster of DB instances instead of a single instance.
- Each connection is handled by a specific DB instance.
- When you connect to an Aurora cluster, the host name and port that you specify point to an intermediate handler called an endpoint.
- Aurora uses the endpoint mechanism to abstract these connections.
- Thus, you don't have to hardcode all the hostnames or write your own logic for load-balancing and rerouting connections when some DB instances aren't available.
- For certain Aurora tasks, different instances or groups of instances perform different roles.
- For example, the primary instance handles all data definition language (DDL) and data manipulation language (DML) statements.
- Up to 15 Aurora Replicas handle read-only query traffic.
- Using endpoints, you can map each connection to the appropriate instance or group of instances based on your use case.
- For example, to perform DDL statements you can connect to whichever instance is the primary instance.
- To perform queries, you can connect to the reader endpoint, with Aurora automatically performing load-balancing among all the Aurora Replicas.
- For clusters with DB instances of different capacities or configurations, you can connect to custom endpoints associated with different subsets of DB instances.
- For diagnosis or tuning, you can connect to a specific instance endpoint to examine details about a specific DB instance.
- The custom endpoint provides load-balanced database connections based on criteria other than the read-only or read-write capability of the DB instances.
- For example, you might define a custom endpoint to connect to instances that use a particular AWS instance class or a particular DB parameter group.
- For example, you might direct internal users to low-capacity instances for report generation or ad hoc (one-time) querying, and direct production traffic to high-capacity instances
                                    
Things to know:

Start with 10GB, scales in 10GB increments to 64TB with Storage Autoscaling.
Compute resources can scale up to 32 vCPU and 244GB of memory.
2 copies of data is contained in each AZ, with minimum of 3 AZs, thus 6 copies of your data at all times.
Aurora is designed to transparently handle the loss of up to 2 copies of your data without affecting database write availability and up to 3 copies of your data withou affecting read availability.
Aurora is also self-healing. Data blocks and disks are continuously scanned for error and repaired automatically.

Aurora Replicas

Three Types of Aurora Replicas:
Aurora Replicas (currently 15)
MySQL Read Replicas (currently 5)
PostgreSQL (currently 1)
Automated failover is only available with Aurora Replicas.

Comparison between Aurora & MySql Replicas
Feature Amazon Aurora Replicas MySQL Replicas
Number of replicas Up to 15 Up tp 5
Replication type Asynchronous (milliseconds) Asynchronous (seconds)
Performance impact on primary when you have Replicas behind Primary Low High
Replica location (in terms of region) In-region Cross-region
Act as failover target Yes (no data loss) Yes (potentially minutes of data loss)
Automated failover (from primary to read replica) Yes No
Support for user-defined replication delay No Yes
Support for different data or schema vs primary No Yes
Backups
- Automated backups are always enabled on Amazon Aurora DB Instances.
- Backups do not impact database performance.
- You can also take snapshots with Aurora, which also do not impact performance.
- You can also share Snapshots with other AWS accounts.
                                    
Amazon Aurora Serverless
- Amazon Aurora Serverless is an on-demand, autoscaling configuration for the MySQL-compatible and PostgreSQL-compatible editions of Amazon Aurora.
- An Aurora Serverless DB cluster automatically starts up, shuts down, and scales capacity up or down based on your application's needs.
- Aurora Serverless provides a relatively simple, cost-effective option for infrequent, intermittent, or unpredictable workloads.
                                    
Migrate MySQL database to an Aurora database
- Select your MySQL database > Actions > Create Aurora read replica
- This will create an Aurora cluster with a Writer and Reader node.
- These nodes will be in separate AZs and also have different DNS Endpoints.
- Select your Writer node > Actions > Promote read replica
- You can also take a snapshot of your read replica and restore it to a new Aurora database.