Deploying Scalable and Resilient Web Application using Heroku
Scalability and resiliency are one of the core tenets of a successful and well-architected system. But sometimes, we don’t have the time, knowledge, or experience to implement scalability and resiliency to our system successfully. To answer this problem, enter Heroku.
In a nutshell, Heroku is an application hosting service. It’ll run your application, be it coded in python, java, golang, etc. As long as it can run in a container using Dockerfile, Heroku can run it.
But Heroku can do much more than host your application. It can connect itself to your code repository to enable the auto-deploy of your application. It can also create multiple environments for testing your apps. It also allows you to scale your deployment up and down quickly.
If you have a Heroku account with billing enabled and choose the professional-tier dyno/execution environment for your app. You can easily add the number of dynos for your app using either the web dashboard or the CLI. This feature is handy in the case of one-time predicted traffic spikes such as on weekends or holidays. Heroku is also developing an autoscale feature that automatically scales your deployment up or down based on the traffic pattern and response time.
Another benefit we get from using Heroku is its resiliency. It’s achieved using auto-restart and immutable deployment. The auto-restart feature lives to its name by restarting your application deployment pods every day or in the event of an irrecoverable error. This ensures that whatever error may be thrown by your application in response to user input, the system won’t just shut down until you intervene manually.
The other feature that contributes to the resiliency of your deployment is immutable deployment. Immutable deployment means that with every restart of the dyno/container, the deployment file gets reset to the original state. This ensures that no matter what happens in a running dyno if there is a problem, the next restart will revert it to the original state when that version is built.
Those are the benefits of using Heroku in terms of scalability and resiliency. It is one of the many reasons I chose to use Heroku for most of my projects.