SquareOps
Get an architecture review
CASE STUDYEdTech

Mathleaks Migration to AWS

How Mathleaks migrated to AWS with multi-region Kubernetes and Aurora, cutting costs 20-25% while serving the US and Europe with high availability.

December 20, 20222 min read

On this page

The Challenge

Mathleaks is an Edtech company with Global footprints that provide students online answers and solutions to all math courses. The company was launching in the USA was struggling to find the solution for running their application in both the USA & Europe with scale and cost-efficiency.

  1. The existing infrastructure was scattered and on multiple local clouds providers with no to minimum elasticity.
  2. Deployment of the application to multiple regions was a manual process which was very inefficient.
  3. The database was a major challenge since they require a common database across regions which will provide them the throughput and speed required to serve the customers.

Solution’s Implemented

The goal was to migrate the entire system to AWS Cloud for elasticity, process, and simplicity.

  1. Kubernetes Deployment: Applications were migrated to Kubernetes infrastructure to provide a consistent environment with containerize approach to scale efficiently as per the traffic along with high availability.
  2. Global Deployment: Continuous integration & Continuous deployment were built to deploy the application to multiple regions (USA & Europe) with dynamic configuration changes as per the region of deployment.
  3. Global Traffic: Route53 was used with Geo location-based routing to direct traffic based on the origin of traffic with the lowest latency for the user. It also provided High availability in case there is an issue with one region.
  4. Monitoring & Alerting: Initially there was no monitoring and alerting solution setup for the website and the first task was to set up the monitoring solution. Prometheus ( Data capturing) and Grafana (visualization & alerting) were used to send the warning and critical alerts for any service going down.
  5. AWS global Aurora: Aurora Global Mysql was used for providing the High Throughput and global availability with the least latency for the database-intensive website by having a primary and secondary clusters in both regions.
  6. Cost Optimization: Autoscaling was achieved using Fleet of Spot instance which helped save cost and all non-production environments were auto-shutdown and start using cloudwatch events & lambda functions for manual maintenance.
  7. Backup’s: DB backups were configured & AMI was created

Results

  1. The system was elastic & can scale based on the user traffic.
  2. System Failure was eradicated by providing high Availability & global reach.
  3. Ease of use for the Developer to deploy & debug.
  4. Overall Cost was reduced 20-25% and achieving high availability & security
FAQs

Mathleaks case study: FAQs

Mathleaks moved from several local cloud providers to Kubernetes on AWS. CI/CD pipelines deploy the application to both the US and Europe with region-specific configuration, and Amazon Route 53 geolocation routing sends each student to the region with the lowest latency. If one region has a problem, the other keeps serving.

Mathleaks uses Amazon Aurora Global Database for MySQL, with a primary cluster in one region and a secondary cluster in the other. This gives the database-heavy site high throughput and global availability with low latency for students in both regions.

Mathleaks' overall costs fell by 20 to 25%. Autoscaling runs on a fleet of Spot Instances, and non-production environments shut down and start up automatically with CloudWatch Events and Lambda functions. The platform also gained high availability and better security.

Before the migration, the website had no monitoring or alerting. SquareOps set up Prometheus to capture data and Grafana for dashboards and alerting, which sends warning and critical alerts when any service goes down. Database backups and AMIs were also configured.

Planning a similar project?

Start with a free architecture review. The engineers who run engagements like this one look at your setup and tell you what they would change first.

Newsletter
Cloud ops notes, monthly

Kubernetes upgrades, cost findings and incident write-ups from real engagements.