Metered, pay-as-you-go Cloud Computing services come in all kinds of flavors. Infrastructure as a Service (IaaS) offerings like AWS allow enterprises to shift their entire operations away from traditional data centers. The downside is that you’ll have to manage networking and provisioning yourself. On the other hand, Platform as a Service (PaaS) providers like Heroku, offer abstracted environments into which developers can simply drop their code and let the platform take care of the provisioning details. You’ll give up some control, but gain simplicity and speed in exchange.
Heroku itself, by the way, is built entirely on AWS cloud servers.
It uses Git (a distributed version control system for code management) to manage application deployments. All you’ll need to do to deploy your application on Heroku is push your Git repository to their servers.
Heroku…
Heroku supports the Ruby, Node.js, Python, Java, Go, PHP, and Scala programming languages. This provides easy deployment of existing technologies on Heroku with minimum modifications needed.
Dynos, like AWS instances or Azure virtual machines, are individual virtual servers built on Ubuntu images. If your application runs on Ubuntu, it’ll be fine on Heroku. There are three types:
As of now, you can choose from these dyno sizes:
Heroku is particularly well known for being able to instantly scale the number of dynos up or down, but they also provide automated load balancing for incoming HTTP requests and failover between hosts. You don’t even have to know there was a problem.
Heroku supports a very large collection of third-party add-ons for users to instantly provision as attachable resources for their applications. Provisioning an add-on (the Papertrail application logger, in this case) is no more complicated than running a single command from your command line interface (CLI):
heroku addons:create papertrail
Each time you add an add-on to one of your applications, your application will automatically be assigned one or more environment variables, which specify any credentials you may need to interact with your new tool. In the case of Papertrail, you will have full access to your logs through the Heroku apps web interface.
Heroku PostgreSQL, Heroku’s hosted, vertically scalable, database service that’s available in the cloud or on your local workstation, is similarly provisioned using:
heroku addons:create heroku-postgresql
But of course, being a database, the Heroku PostgreSQL is significantly more complicated to configure.
Heroku also offers High Availability and Automatic Failover with its DB.
Based on Heroku founder Adam Wiggen’s Twelve Factor App, you should ideally keep these considerations in mind when designing your Heroku deployments (or, for that matter, any deployments):
One of the benefits of using a cloud provider like Heroku in the first place is that you pay only for what you use. In the case of Heroku, since they bill in increments of seconds, that’s pretty much exactly what you use.
Create your own free Heroku account. You will get 512 MB RAM, 1 web/1 worker, which is enough to get started deploying prototype applications.
We’ll work with a Rails application. Refer to this link for help setting up Rails on your workstation.
Download and install the Heroku ToolKit. This will create a local Heroku CLI client for creating and managing your Heroku applications and Git.
Login using the email and password you used for your Heroku account:
Clone your application from git:
Now create an application on Heroku that will receive your Git source code:
Once complete, push your code:
git push "heroku master"
Each Heroku application is assigned a unique URL that automatically routes incoming HTTP requests to your application. Get your application using:
heroku open
It's Flash Sale time! Get 50% off your first year with Cloud Academy: all access to AWS, Azure, and Cloud…
In this blog post, we're going to answer some questions you might have about the new AWS Certified Data Engineer…
This is my 3rd and final post of this series ‘Navigating the Vocabulary of Gen AI’. If you would like…