TechAlpine – The Technology world

Node.js on a PaaS like Heroku

Node on Heroku

Node on Heroku

Overview:

Heroku provides deployment and support services from the cloud for Apps developed on Node.js and various other languages and platforms. In short, Heroku offers Platform as a Service.  It has been one of the most favoured PaaS providers because it offers simple deployment, good support at a low cost and lets the app creators focus on app improvements. Heroku offers various support services suited to the unique requirements of its customers. Heroku is used by enterprises like Asics and Miley Cyrus and it has been used to implement complex use cases for customers like Salesforce. Heroku provides complete transparency to the app creators on the app status, support services, downtime and uptime status and various other aspects related to the app.








What is Node.js?

The Node.js, which was developed by Ryan Dahl in 2009, is a server side platform based on Google Chrome’s V8 JavaScript Engine, also known as the V8 Engine. It is an open source and a cross-platform run time solution for developing networking and server side applications. Node.js applications are created with JavaScript and can be on operating systems such as the Microsoft Windows, OS X and Linux within the Node.js runtime environment.

Node.js offers the following capabilities that make building of web applications simpler.

  • Rich library of JavaScript modules

Availability of readymade and reusable JavaScript modules reduces coding time; improves productivity and helps standardization of software applications.

  • Asynchronous and event driven

Node.js library APIs are asynchronous meaning after the Node.js server calls an API, the server does not wait for the API response and calls the next API and so on. In the meantime, notification mechanism of Events of Node.js receives the responses from the called APIs.

  • Fast execution of code

Since Node.js is built on Google Chrome’s V8 JavaScript Engine, the code execution is very fast.

  • Single thread providing high scalability

Strange as it may seem, the single thread of Node.js is more efficient and scalable than the multiple threads used by traditional servers. The single thread uses event looping for its messaging purposes.

What is Heroku?

Imagine an app that is being built to be self-contained and found on the Internet and not on the app stores. The creator of the app does not want to think too much about app support issues after it is made available on the Internet. For example, the creator does not want to worry too much when the app is put under severe pressure because of traffic spike. Heroku platform does all that for apps meant to be hosted on the Internet. It deploys and hosts apps on the Internet from the cloud and provides support afterwards. Heroku is a Platform-as-a Service (PaaS) offering founded in 2007. With the Heroku interface, deploying apps on the Internet is simple.

Heroku supports apps built on a number of languages through its online runtime environment known as the Cedar stack. Support is provided in the form of a number of services such as downtime scheduling by virtual computers or instances etc.

Heroku lets the creators of apps focus on app improvement and forget about app support issues such as downtime, scaling up or down and scheduling etc.

Why Heroku? – Pros and Cons

The battle in the PaaS domain is intense as other PaaS providers such as Modulus, Microsoft Azure, Linode and Appfog are ever jostling to grab a bigger pie of the lucrative market. But Heroku is most favoured because according to reviewers, its positives tend to outweigh its negatives. Heroku edges out others when it comes to serving small and medium start-ups and enterprises that struggle with cost and portability issues.       The main pros and cons of Heroku are described below.

Pros

  • Supports deployment of apps built with different languages such as Java, Node.js, Scala, Clojure, Python and PHP.
  • Easy deployment of apps which makes Heroku ideal for start-up developers. However, Heroku has been equally popular with large projects because it was chosen for large commercial projects like National VIP and Faces of NY Fashion Week.
  • Heroku provides 24 hours support that includes a frequently updated status.
  • Easy integration with third-party providers such as MongoDB and Redis.
  • Low cost. It is free at entry level.

Cons

  • Professional levels of support are available at a steep price jump.
  • Since it is developed on Ruby on Rails, Node.js applications can face performance issues.
  • Clients may not have control over choice of operating systems and firewall.








Heroku use cases?

This section describes how Heroku helped implement several use cases for Salesforce and solve a number of business problems.

Use cases:

The following broad use cases were identified to be implemented for Salesforce.

  • Finding a storage solution for large volumes of different data types.
  • Optimize processes to improve productivity.
  • Provide intuitive and user-friendly UIs.

Use case implementation:

The following broad measures were taken – Heroku involved – to implement the above use cases.

  • Different third-party applications such as Salesforce, D&B CreditCheck, Shooping.com and Google Analytics were integrated through the use of APIs.
  • A number of add on services were used such as Runscope and IronMQ.
  • Publish data and business logic stored in Salesforce.
  • To solve the problem of customer interactions through multiple channels such as SMS, email, Twitter, Instagram and Voice server, interactions were automated with maximum flexibility.
  • User or lead information could be retrieved with a lot of ease.

How Heroku works?








First of all, Heroku supports the deployment of a number of apps built on a number of languages such as node.js, Scala, Clojure, Python and PHP and Java.

When an app is created on Heroku, it deploys the app on Cedar Stack which is its runtime environment.  The latest version of Cedar Stack is Celadon Cedar. After deployment, Heroku assigns a unique name, based on a natural theme to the app, for example, calm-mountains3209. That done, the primary purpose of taking the services of Heroku are fulfilled. The app is now available on the Internet for the public and it is the turn of the support services.

How do the support services work? Heroku has what can be called virtual computers or instances that provide the support services. The instances are known as dynos and each dyno offers a specific service. For example, a dyno can do scheduled downtime and uptime for an app. Then there is the Heroku Scheduler which can make apps active at a specified frequency.

Getting started

In this section, we will explore the steps how Node.js applications can be deployed on Heroku.

Here you need to create a FREE Heroku account and install Node.js locally. Then you need to download and install Heroku Command Line Interface (CLI), which was earlier known as Heroku Toolbelt.

Step 1: Create FREE Heroku account.

Step 2: Install Node.js locally.

Step3: Install Heroku CLI. It will help to run applications locally.

Once these steps are complete, you can create Node applications and deploy on Heroku.

Conclusion

While Heroku is a much-favoured PaaS solution for many, it needs to be noted that it is not a fit-for-all solution. In fact, none of its competitors, some of whose names have been mentioned here offer a comprehensive solution. For example, while Microsoft Azure is suited for large scale projects, the Linode is good for Linux developers who want community support from a forum. Though Heroku is seen as good for start-ups, it has also been used for large-scale project which is an interesting point. But still, the simplicity and the broad base of support offered by Heroku remains its unique selling point as the PaaS space become moiré crowded. It remains to be seen whether the PaaS providers are going to come out of their comfort zone to offer more.

 

Tagged on: , ,

Leave a Reply

Your email address will not be published. Required fields are marked *


1 × = 6

TechAlpine Books
-----------------------------------------------------------