Now a days big discussion going on serverless architecture, I have tested my database serverless scalable architecture for LAMP applications.
If you are looking to build serverless architecture for LAMP. Here is the guide how to design serverless architecture for any LAMP application.
So here is how to design / use scalable serverless MySQL database architecture.
I have divided my stack architecture in two part:
1.) Application Servers
2.) Database servers
I have used AWS EC2 for application server and AWS Aurora Serverless MySQL for database server.
So AWS EC2 instance stack look like below:
I didn’t use Client Environment with Cloud9, instead I use EC2 micro instance with MySQL client only enough to connect aws aurora serverless.
Note : Mysql client only not mysql server
But I also used phpMyAdmin to verify it working properly for LAMP application.
So need to install Apache, PHP and phpMyAdmin and configured phpMyAdmin to connect database server remotely.
Here is how to install and configure Apache, PHP
And here is how to install and configured phpMyAdmin to connect database server remotely.
https://websiteforstudents.com/manage-remote-mysql-databases-via-phpmyadmin-on-ubuntu-17-04-17-10/
Advantages of Aurora Serverless:
Aurora Serverless provides the following advantages:
Simpler
Aurora Serverless removes much of the complexity of managing DB instances and capacity.
Scalable
Aurora Serverless seamlessly scales compute and memory capacity as needed, with no disruption to client connections.
Cost-effective
When you use Aurora Serverless, you pay for only the database resources that you consume, on a per-second basis.
Highly available storage
Aurora Serverless uses the same fault-tolerant, distributed storage system with six-way replication as Aurora to protect against data loss.
Aurora Capacity Units (ACUs)
Database Capacity
In Aurora Serverless, database capacity is measured in Aurora Capacity Units (ACUs). 1 ACU has approximately 2 GB of memory with corresponding CPU and networking, similar to what is used in Aurora Standard instances. You pay a flat rate per second of ACU usage, with a minimum of 5 minutes of usage each time the database is activated.
1 Aurora Capacity Unit (ACU) | $0.06 per ACU Hour |
Database Storage & I/O
Storage consumed by your Amazon Aurora database is billed in per GB-month increments and I/Os consumed are billed in per million request increments. You pay only for the storage and I/Os your Amazon Aurora database consumes and do not need to provision in advance. Amazon Aurora storage and I/O prices are the same for Standard and Serverless configurations.
Storage Rate | $0.10 per GB-month |
I/O Rate | $0.20 per 1 million requests |
Limitations of Aurora Serverless
The following limitations apply to Aurora Serverless:
- Aurora Serverless is only available for Aurora with MySQL 5.6 compatibility.
- The port number for connections must be
3306
. - You can’t give an Aurora Serverless DB cluster a public IP address. You can access an Aurora Serverless DB cluster only from within a virtual private cloud (VPC) based on the Amazon VPC service.
- You can’t access an Aurora Serverless DB cluster’s endpoint through an AWS VPN connection or an inter-region VPC peering connection. There are limitations in accessing a cluster’s endpoint through an intra-region VPC peering connection; for more information, see Interface VPC Endpoints (AWS PrivateLink) in the Amazon VPC User Guide. However, you can access an Aurora Serverless cluster’s endpoint through an AWS Direct Connect connection.
- A DB subnet group used by Aurora Serverless can’t have more than one subnet in the same Availability Zone.
- Changes to a subnet group used by an Aurora Serverless DB cluster are not applied to the cluster.
- Aurora Serverless doesn’t support the following features:
- Loading data from an Amazon S3 bucket
- Invoking an AWS Lambda function with an Aurora MySQL native function
- Advanced auditing
- Aurora Replicas
- Backtrack
- Database cloning
- IAM database authentication
- Cross-region read replicas
- Restoring a snapshot from a MySQL DB instance
- Migrating backup files from Amazon S3
- Connecting to a DB cluster with Secure Socket Layer (SSL)
Note
You can access an Aurora Serverless DB cluster from AWS Lambda. For more information about working with AWS Lambda, see Configuring a Lambda Function to Access Resources in an Amazon VPC in the AWS Lambda Developer Guide.
More information can be found here:
https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/aurora-serverless.html
https://aws.amazon.com/rds/aurora/serverless/
https://aws.amazon.com/rds/aurora/
https://aws.amazon.com/blogs/aws/aurora-serverless-ga/
https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/aurora-serverless.create.html
https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/Aurora.CreateInstance.html
https://www.jeremydaly.com/aurora-serverless-the-good-the-bad-and-the-scalable/
Recent Comments