The database is behind the scenes giving your online store great performance, storing your customer data and all the important information about purchases. Thus, it’s a service that needs to be done for your business to function properly.
Wouldn’t it be great then if the database would work precisely adjusted for the highest level of performance of your Magento store without the need for you to be manually modifying configurations and doing time-consuming administrative tasks? Now Amazon Aurora supports Auto Scaling for Aurora Replicas, and you can ensure that the desired number of Amazon Aurora replicas are run at any given time and condition so your database can keep up with the increasing demands of your application.
It works in the following way, Aurora automatically increases the number of replicas when demand increases during traffic jumps, or on schedule to maintain performance and availability, and decreases capacity during off hours to reduce costs. This feature makes your database cheaper and more efficient, and it frees you to focus on your business.
What is Amazon Aurora?
Amazon Aurora is a MySQL and PostgreSQL compatible database offered on RDS (Relational Database Service), a hosted database service in the AWS cloud. Traditional databases were designed and optimised for on-premise servers. However, when it comes to the cloud, these databases are unable to take advantage of the flexibility, scalability, and performance improvements inherent to cloud architecture. Cloud-native database solutions, like Amazon Aurora, make database creation, management, and maintenance easier and more efficient so users may fully utilise and take advantage of these cloud attributes.
Amazon Aurora is the most popular database engine on RDS right now. It provides up to five times better performance than a traditional MySQL installation, and it has unique features such as auto-scaling storage, extremely low-latency replication, and rapid automated failover to a standby instance.
When you have a system with only one database server responsible for both delivering and fetching information, or in other words, responsible for writing and reading, your system can quickly become overloaded with too many tasks to handle at once. For instance, you might have a TV campaign in place which will generate sudden high peaks of traffic, which in turn will cause your database/system to become overloaded. Then how do you keep up with the needs of an ever-growing database?
Our Solution for Magento 2
By default, Magento 2 CE version doesn’t support read/replica connections. You can define multiple types of connections in app/etc/env.php, but in your modules, you need to determine which connection you want to use for executing queries. To provide a solution for our customers we have developed a module which automatically decides whether the master connection or the replica endpoint should be used.
In our module, the routes can be defined, so you can specify which ones should only use the master connection, for example, the entire admin area (/admin/*) or the complete checkout process, and which ones should use the replica endpoint.
Increase availability: you can use Aurora Replicas as failover targets. That is, if the primary instance fails, an Aurora Replica is promoted to the primary instance for faster recovery in the event of a disaster. For high-availability scenarios, we recommend that you create one or more Aurora Replica. You can also increase database availability by locating Aurora Replicas in separate Availability Zones.
Read Replicas provide enhanced performance and durability: Use Read Replicas to scale read capacity. By distributing the read workload, you void an overloaded system, thus keeping maximum performance at all times. You can also place your read replica in a different AWS Region closer to your users for better performance.
It helps your database to grow according to your company’s changing needs: In summary, you can scale your Aurora configuration up or out to meet the growing needs of your applications effortless. RDS takes care of the heavy lifting in scaling your database so you can focus more on your applications.
Easily meets connectivity and workload requirements: Aurora Auto Scaling enables your Aurora DB cluster to handle sudden increases in connectivity or workload.
Save on costs: Since Reading Replicas are automatically terminated when they are no longer needed, you won’t have to pay for instances which are unnecessary.