Scaling using ElasticBeanstalk: Migrating the API
SilverOrbit loves helping it’s partner on scaling the application using AWS technologies.
A mobile application that will cater gym goers. The problem is that running on a single server would not scale when users are getting many requests. Planning the simple transition from VPS to AWS with auto-scaling property is a way to do it.
Considerations:
- Time needed to rewrite the API codes and get to new infrastructure.
- Developer only need to do simple edit to the API codes.
- Simple Deploy with DEV and PROD environment
With these consideration, we decided to use Elastic Beanstalk to speed up migration and focus on the mobile app development than to the API coding. Although micro-services can be considered here, using Lambda or API gateway. The micro-service and server-less can be good options for this too, probably for next improvement on this project.
Current Setup:
The API server for mobile app is on a single VPS together with the assets which includes images and static files.
Solution:
- Host static assets files to S3 and use Cloudfront as our CDN.
- The API codes will insert images on S3 buckets using IAM credentials too.
- A separate RDS database to be used by API server for user profiles, and other information.
- CNAME the ElasticBeanstalk URL and Cloudfront
- ElasticBeanstalk easy configuration for Autoscaling features
- The image for the actual changes on the infrastructure.
By having this kind of setup we have great results: scalable web servers and assets files are serve via CDN. The transition works seamlessly in a short time.