Вы находитесь на странице: 1из 15

Cloud Platform As a Service: Heroku

An example walkthrough

- Pulak ( http://pulakonline.com, @pulakb )


What is Cloud Computing
Cloud computing is a way of delivering services over network. It is a ubiquitous
IT services over the network.

In other words, Cloud computing is a general term for the delivery of hosted
services over the Internet.
Characteristics of Cloud Computing

● On Demand Self Service Provisioning


● Broad Network Access
● Resource Pooling
● Measured & Metered Service
● Rapid Elasticity
Service Model available in Cloud

● Iaas (Infrastructure as a Service)


○ Server space, i.e. storage
○ RAM
○ Processor
○ Network connections
○ Load balancers

● Paas (Platform as a Service)


○ This category of cloud computing provides a platform and environment to allow developers to build
applications and services over the internet. PaaS services are hosted in the cloud and accessed by users
simply via their web browser.
○ Platform as a Service allows users to create software applications using tools supplied by the provider.
Service Model available in Cloud

● Saas (Software as a Service)


○ Any cloud service where consumers are able to access software applications over the internet. The
applications are hosted in “the cloud” and can be used for a wide range of tasks for both individuals and
organisations.
○ SaaS is often referred to as software-on-demand and utilising it, in other words, renting software rather
than buying it.
Heroku

Heroku (pronounced her-OH-koo) is a cloud application platform – a new way


of building and deploying web apps.

Their service lets app developers spend their time on their application code, not
managing servers, deployment, ongoing operations, or scaling.
Heroku - Features
● Build and Run Your Apps, Your Way.
○ Add-ons
○ Buildpacks
○ Config
○ Run
● Deploy your app quickly, easily and with options that work for you.
○ Deploy with Git
○ Heroku Fork
○ Releases
○ Regions
Heroku - Features
● Scale with ease, when you need to

Heroku lets you grow quickly to support user growth, traffic spikes and new features.

● Dyno Size
● Scale easily
● Addons: upgrade
● Dashboard scale
Heroku - Features
● Get comprehensive visibility and monitoring.
○ Heroku Logs
○ Monitoring add-ons
○ Status
● Heavy Duty Tools
○ Dashboard
○ Toolbelt CLI
Heroku - Setup
Download HerokuToolbelt for

● Mac OS X
● Windows
● Debian/Ubuntu
● Standalone

This provides you access to the Heroku Command Line utility, as well as git and Foreman, tools you’ll use in later
steps.

Link: https://devcenter.heroku.com/articles/getting-started-with-nodejs#set-up

Login:

$ heroku login
Heroku - App Concepts
What is a Procfile?

A Procfile is a text file which is put in the application root directory. It lists the process types such as ‘web’, ‘worker’ in
an application.

Define a Procfile:

web: node app.js

The above line declares a singles process type, web and the command required to run it. It is important to declared the
name web here as this process will be attached to the HTTP routing stack of Heroku and will receive web traffic upon
deploying.

You can add more than one processes in this file.

web:

This special process type receives HTTP traffic from Heroku’s routers.
Heroku - App Concepts
Package.json:

Create a package.json file to list download all your node module dependencies. When you deploy your app in Heroku,
the platform will run ‘npm install’ command to install all the specified node modules.

Foreman:

It is a service that manages processes (specified in Procfile) for an application to run properly. In other words, it
manages profile-based applications. It will start all of the processes associated with your app and display stdout and
stderr of each process. Processes are color-coded by type to make them easy to read. $PORT will be automatically
assigned by foreman and made available to each underlying process.
Heroku - App Deployment
Prepare the App (without DB Interaction):

$ git clone https://github.com/heroku/node-js-getting-started.git

$ cd node-js-getting-started

Deploy the App:

$ heroku create

$ git push heroku master

Now visit the app at the URL generated by its app name. As a handy shortcut, you can open the website as follows:

$ heroku open
Heroku - App Deployment
Deploying Local folder(without DB Interaction):

cd <<FOLDER_NAME>>

$ git init

$ git add .

$ git commit -m “committing first time ”

$ heroku create

$ git push heroku master


Q&A

Slides are prepared after attending, reading & using resources from Internet. Credit goes to everyone in preparing it.

Вам также может понравиться