KeyQ Blog

Save 64% on AWS costs by migrating to Kyte and Graviton2

Written by Kenneth Hough | Dec 3, 2020 2:02:00 PM

The existing solution was not scalable

Zerocafé is a Tokyo-based company that offers subscription based drink-service for café and bar owners to attract more customers. The company had previously contracted out the development of an app and the associated backend on AWS but was experiencing several issues, including:

  • Costly AWS bills, which worsened when attempting to scale
  • Degraded performance affecting customer UX and churn
  • Complicated and unstable tech stack to support scaling of a monolithic app

These issues not only impacted the businesses operating expenses but was resulting in increased customer turnover and reduced traction.

Migrating to Kyte and AWS's Graviton2 platform

After our discussion with Zerocafé business owner, Yoshiyuki Waguri, we explained the benefits of microservice architecture and how Kyte can improve cost-performance by:

  1. Scaling down the EC2 instance type to match Kyte's small resource footprint
  2. Removing costly state-management solutions (Kyte is a stateless framework)
  3. Decentralize and offload certain workloads to AWS resources, such as SES, SNS, S3, Lambda, API Gateway, and Step Function

These changes will need to be conducted in parallel with operating the existing infrastructure, followed by a migration plan to minimize downtime. During these steps, AWS costs will inadvertently increase due to the increased resources being deployed while maintaining the existing infrastructure, however the cost savings gained after the migration will make up for the temporary increase in opex.

One of the precautions we implemented even before starting the migration was switching their DNS service provider to Cloudflare. With Cloudflare's DNS proxy service, not only can you secure your records but offer quick and seamless updates to your DNS records with minimal impact to your clients, as the changes occur behind the scenes. The migration to Cloudflare greatly helped with making the overall migration smooth.

The new infrastructure involved a backend running KytePHP™ on several t4g.nano instances beind an application load balancer. Static and user generated content were stored in respective S3 buckets and no longer on the severs themselves (yikes!). A Cloudfront distribution was configured for each of the static and user generated content, increasing content delivery performance.  Lamda, API Gateway, and Step Functions were used for scheduled routine functions.

Overall, we were able to reduce Zerocafé's AWS costs by 64% while improving their performance.  Ripping the bandage in order to fix and optimize legacy tech stacks can be very painful, but the benefits gained from an optimized infrastructure is priceless. If you are experiencing similar cost-performance issues, don't hesitate to reach out to us even if it is just to discuss best-practices and potential solutions.