Aurora and Aurora Serverless
Learn about the key concepts of a high-performance relational database, Amazon Aurora and Aurora Serverless.
Amazon Aurora is a fully managed, cost-effective, and high-performance relational database. It allows us to use the power and flexibility of popular open-source databases like MySQL and PostgreSQL with enhanced throughput. We can create and configure Amazon Aurora using the same Amazon RDS Management Console.
The configuration of Amazon Aurora includes a DB cluster that can consist of one or multiple DB instances. Even a single DB instance will be a part of a DB cluster because of the underlying storage architecture of the Amazon Aurora. Cluster storage consisting of multiple nodes is associated with the DB cluster that can span multiple availability zones, and the cluster’s data is copied to all the nodes.
Note: No reader instances are created when creating an Aurora database in a Single-AZ (not highly available and durable).
High availability in Amazon Aurora
Amazon Aurora offers high availability for storage and computing independent of each other.
High availability for storage: Amazon Aurora is highly available from a data and computing perspective. It separates the compute layer from the storage layer in Aurora, allowing it to replicate data and make it highly available irrespective of the DB instances’ state. Aurora creates six copies of the data and spreads it across three AZs in the same AWS Region. All these copies are attached to the DB cluster and get updated synchronously.
High availability for compute: While working in a Multi-AZ deployment, Aurora creates one primary DB instance and one read replica or read-only instance in different AZs. Amazon Aurora DB cluster can have up to 15 read replicas and a primary instance across different Availability Zones. Read replicas do not add additional storage costs, as all the DB instances use the same shared storage. Aurora replicas can be configured as a failover point, meaning that if a primary instance goes down, the replica instance will be promoted to the primary instance.
Aurora global databases
Global databases are the secondary DB clusters spanning up to five read-only DB clusters in different AWS Regions. Each read-only DB cluster can have 16 (because there is no writer instance) reader instances. The primary DB cluster performs the read/write operations and replicates the data asynchronously to the secondary DB clusters. Global databases are best suitable for applications and businesses that want to show their presence worldwide.
Cross-region read replicas
Amazon Aurora allows the creation of replicas in different AWS Regions to ensure maximum availability and readability. Cross-region replication can be achieved using Aurora global databases or the native replication schemes of MySQL and PostgreSQL. Aurora MySQL uses its traditional approach of binary logs (binlog) for cross-region replication, while Aurora PostgreSQL does not support cross-region replication, but we can use global databases to create read replicas in different regions.
Aurora backups and snapshots storage
There are two types of backup options in Aurora: automated (continuous) and snapshots (manual). The automated backups are incremental and store all changes within the specified retention period. The retention period of automated backups can be from 1 to 35 days, and we can restore the database to any point in time within the retention period.
Note: The default retention period for Amazon Aurora is seven days, and it does not charge for backups with one day retention period.
Snapshots are the full backups of the DB cluster, and their size is equal to the volume of the cluster at the time the snapshot is taken. Snapshots taken within the retention period of automated backup get free unlimited storage, but once the retention period is over, snapshots are charged monthly per GB usage.
Aurora Serverless
Aurora Serverless is an on-demand configuration for MySQL and PostgreSQL-compatible databases. It allows autoscaling, monitoring and managing workload, and adjusting the capacity of the database according to the applications’ needs. Because it provisions on-demand resources therefore, it is more cost-efficient than the standard Aurora clusters.
There are two versions of Aurora Serverless. The v2 is the latest version that is faster and more compatible with other Aurora features and is recommended. Let’s see some of the common use cases, advantages, and requirements of Aurora Serverless v2 in the table below:
Use Cases and Advantages
Use Cases | Advantages |
Capacity planning: No need to worry about changing the DB instance class with the varying workload. Aurora Serverless v2 can take care of this automatically. Existing provisioned Aurora clusters can be modified to serverless and vice versa. | Cost-effective: Aurora Serverless saves the cost of provisioning fixed-size DB instances while not being used to their full capacity. |
OLTP: In applications like online transaction processing, there are chances of a surge in user interaction. Amazon Aurora Serverless v2 helps autoscale the read replicas according to the workload, and once the traffic becomes normal, it scales down the DB replicas. | Capacity management: Aurora Serverless helps monitor and manage database workload and capacity. |
Multi-tenant applications: We don’t need to manage the database capacity for each application. Aurora Serverless v2 monitors the workload of individual applications and manages the capacity accordingly. This can save us a lot of time in manual monitoring and managing because each application can have its different workload routine. | Autoscaling: Aurora Serverless v2 provides easy and fast scaling of compute and memory capacity as required. It happens seamlessly, and no delay is experienced in the workload. The support of Aurora global databases also helps in scaling. |
New applications: We can deploy new applications with Aurora Serverless v2 if we are not sure about the workload of our application. Aurora Serverless will autoscale the DB cluster if required. This will save us from incurring extra charges for provisioning DB instances in larger instance classes. | More advanced than v1: Aurora Serverless v2 is more efficient than v1. It is designed for the variable workload and it scales up and down faster than the v1. V2 is more granular as it changes the capacity by 0.5 Aurora Capacity Units (ACUs). |
Development and testing: We can also use Aurora Serverless in a testing environment. Instead of fixed-size database capacity, we can define minimum and maximum capacity, and the Aurora Serverless will perform the autoscaling as required. | Extended support: Aurora Serverless v2 supports the Aurora features like reader DB instances, global databases, and IAM DB authentication, which are unavailable in v1. |
Get hands-on with 1300+ tech skills courses.