AWS Infrastructure Update and Cost Optimization 

One of the main focuses of using AWS is to ensure the optimal utilization of resources. 

This AWS Infrastructure Update and Cost Optimization case study revolves around a project in which we assisted one of our clients to achieve client achieve remarkable outcomes like cost reduction by 10%​, Infrastructure Upgrade​, Security Improvements​, Robust Backups & disaster management​

As the application user base increased, the load on the existing infrastructure surged leading to degraded performance.

To meet this growing demand, we didn’t opt for costly vertical scaling of our monolithic application infrastructure. Instead, we recognized the need to transition to a 2-tier architecture.

This change allowed us to utilize cost-effective storage services and efficiently scale the affected resources, ultimately leading to substantial cost savings.

Current Infrastructure and Challenges:

The existing infrastructure of the application relies on a monolithic architecture to support its operations.

This server serves multiple functions, including hosting the website, managing the database, and storing user media files on the file system. However, this setup presents several challenges and limitations that need to be addressed.  

Challenges with the Current Setup

  1. Scaling: The monolithic architecture presents challenges when it comes to scalability since each component cannot be independently scaled. As the number of database I/O requests and file storage requirements grows over time, the server’s Elastic Block Store (EBS) needs to be scaled, which can be quite expensive.

    Scaling up a single server becomes impractical, as it requires larger server instances and increased storage capacity, resulting in higher costs and hindering efficient infrastructure scaling.  
  2. Security: While AWS provides many security measures for the server instance, having the entire infrastructure concentrated on a single server increases vulnerability to potential attacks and data breaches.

    If one layer is breached, the exposure of the database and user media files becomes a significant concern. A more secure architecture with additional security layers is necessary to mitigate risks and safeguard sensitive data. 
  3. Backup Management: Managing backups for the database files has proven to be a challenging task. As the application and associated data expand, ensuring reliable and up-to-date backups becomes increasingly burdensome.

    An improved backup strategy with automated processes for individual components is essential to maintain data integrity and facilitate efficient disaster recovery.  

Addressing these Challenges with AWS Infrastructure Update and Cost Optimization

Addressing these challenges with AWS Infrastructure Update and Cost Optimization is crucial to enhancing the overall performance, security, and scalability of the application’s infrastructure.

It necessitates the implementation of a more robust multi-tier architecture, separating code, using media storage and database components, enhancing security measures, and implementing efficient and automated backup processes as the application continues to grow.  

Key Requirements:

The key requirements for this project were to improve application architecture by effectively using dedicated AWS services for database and file storage along with cost reduction.

Solution Design:

An overview of relevant AWS services, including RDS, S3, Database Migration Service (DMS), and EC2, was conducted to understand their capabilities and how they would address requirements.  

  1. Migrate the MySQL Database from EC2 Server to a Dedicated RDS Instance on AWS:  To overcome the challenges associated with database management, it was essential to migrate the MySQL database from the existing EC2 instance to a dedicated RDS instance.

    This migration aimed to improve maintainability, security, scalability, cost reduction, and automated backups.  
  2. Static Files management using S3 Bucket: To optimize storage and improve scalability, we planned to have a separate S3 bucket for static file management along with the migration of static files hosted on the EC2 instance to Amazon S3, which is an efficient and cost-effective storage service.  
  3. Improve Security of the Server and Database: Enhancing the overall security of the infrastructure, especially the server and database, was a critical requirement. The migration to individual AWS services would provide opportunities to implement additional security measures.  

Database Migration:

  • The migration process utilized the Database Migration Service (DMS) to seamlessly transfer the database. DMS facilitated live changes during migration, ensuring data consistency without requiring any downtime.  
  • DMS also provided monitoring capabilities, enabling the tracking of schema and table migration progress. This feature allowed for the validation of data transfer from the source to the target, ensuring the integrity of the migrated data.  
  • The adoption of the new RDS instance introduced an additional layer of security by enabling the management of incoming requests to the database. Access to the database was restricted to requests originating from the server, enhancing the overall security posture.  
  • Furthermore, the RDS instance played a vital role in reducing the server load by optimizing the occupied space and improving query performance.   

File migration:

  • S3 storage service was utilized for the storage of static files. S3 provides a reliable option to store and fetch static files. Required Code changes were made to ensure files were stored in a bucket with proper permissions.  
  • The migration of static files involved using the AWS CLI to transfer the files from the existing server to the newly created S3 bucket. AWS CLI provided a simple and efficient method to securely and swiftly move the files, ensuring data integrity and minimal disruption.   

Monitoring and Alarms:

  • RDS instance facilitated individual database monitoring using CloudWatch service, enabling the tracking of memory utilization, RAM usage, and other metrics. Alarms could be set to alert for specific thresholds related to space, memory, or I/O requests.   
  • Similar Monitoring was established on the server to monitor CPU Utilization, Disk space usage, and memory Utilization.  
  • This enhanced application efficiency, allowing for dynamic adjustments to the database and server configurations based on traffic levels.

    This level of control over resource allocation provided cost optimization opportunities by scaling resources when necessary, during peak traffic periods and reducing costs during periods of lower traffic.

AWS Cost Optimization:

AWS Cost Optimization
  • The new infrastructure design brought about significant cost optimization. By segregating the database into an RDS instance, we successfully reduced the required instance size and storage space, leading to cost reduction.

    Moreover, the ability to scale the database based on traffic enabled us to closely monitor the database and adjust configurations as needed, resulting in a cost-optimized infrastructure.  
  • Furthermore, the utilization of S3 for file storage proved to be a cost-effective solution, as charges were based on the actual space utilized.

    Transitioning from EBS-based storage to S3 storage resulted in optimized space utilization since EBS cost more than S3, further contributing to cost efficiency.

Leveraging the AWS platform, we’ve been able to seamlessly scale our infrastructure, better serve our customers across the globe, and reduce our fixed costs by 75% and operational costs by 83%.

Valentino Volonghi, CTO

Improved Disaster Recovery Capabilities:

The new infrastructure setup improved the application’s disaster recovery capabilities.

We ensured data safety and infrastructure reliability by:

  • Setting up regular backups for the EC2 instance.
  • Employing a separate Amazon RDS instance with automated backup processes.
  • Minimizing infrastructure failures and data loss.
  • Isolating failures to specific resources, enhancing system availability and recovery.

The migration from a Monolithic architecture to utilizing individual AWS services, namely Amazon RDS, Amazon S3, and Automated Backups, yielded several positive outcomes.

The new infrastructure design addressed challenges related to cost, performance, security, maintainability, and scalability. It provided a more efficient and reliable system for code changes and application deployment, enhanced security measures, optimized costs, and improved disaster recovery capabilities.

Overall, the transition to a service-oriented architecture proved to be a valuable investment, facilitating its growth, stability, and future expansion.

Next Step
To learn more about how Bitkraft can help with managed cloud services, contact us.

 

Share your love
Bitkraft Technologies
Bitkraft Technologies
Articles: 16