Chapter 10. Deploying with Cloud-based Services

Inevitably, you'll want the application you've been building to be online and available to the world—whether you want to host your application online during its development process or whether it's complete and ready for production. There are a number of different hosting options currently available for Node.js- and MongoDB-based apps, and in this chapter, we'll take a look at deploying to a few different popular services.

In this chapter, we will cover:

  • Cloud versus traditional web hosting
  • Introduction to Git source control
  • Deploying an application with Nodejitsu
  • Deploying an application with Heroku
  • Deploying an application with Amazon Web Services
  • Deploying an application with Microsoft Azure
  • A brief look at Digital Ocean

Cloud versus traditional hosting

If you have had any previous experience with website hosting in the past, which I'll refer to as traditional hosting, you're probably pretty familiar with the process of using FTP to upload your web files to your hosting provider. With traditional web hosting, service providers typically offer shared space to every user, each configured with their own public folder that houses the web files. In a scenario like this, every customer is hosting the same kind of website, and their files are all stored and served from a single web server.

Traditional web hosting is fairly inexpensive because a single web server can host literally hundreds, if not thousands, of individual websites. Scaling is typically a problem with traditional hosting because if your website demanded more power, it would need to be moved to another server (with more hardware) and could experience potential downtime during this move. As a side effect, if a website on the same server as your own is being particularly demanding of the hardware, every site on that server could suffer.

With cloud-based hosting, every instance of a website or service is hosted on its own Virtual Private Server (VPS). When a customer uploads a copy of their website, that website is running in its own isolated environment, and the environment is specifically designed to run only that website. Virtual private servers are instances of a server, typically all running simultaneously on the same hardware. Because of their isolated nature, VPS scales very well because settings simply need to be changed for hardware allocation and the server restarts. If your VPS is hosted on the same hardware as others, and they are experiencing high-volume spikes, your website will not suffer because of the isolated nature of the VPS.

Infrastructure as a Service (IaaS) versus Platform as a Service (PaaS)

The beauty of the cloud is that the level and amount of service one can obtain varies greatly. From something as simple as a basic hosting plan to run your web application, you can use any number of services that are considered a Platform as a Service (PaaS). This is a service that provides a platform for you to host and run your web application. Increasing in scale and complexity, you can turn to an Infrastructure as a Service (IaaS) provider, which offers an entire cloud-based data center at your disposal.

Note

You can learn more about the differences between IaaS, PaaS, and Software as a Service (SaaS) by reading this detailed article at:http://www.rackspace.com/knowledge_center/whitepaper/understanding-the-cloud-computing-stack-saas-paas-iaas

Cloud-based hosting costs can vary greatly because of the simple fact that they are so scalable. Your costs could fluctuate throughout a single month dramatically depending directly on your need for power (that is more demanding times of the month and/or big social media hits such as HackerNews or Reddit). On the flip side, if you require very little power for a server, often you can get cloud hosting for free!

Traditional web hosting service providers include GoDaddy, Dreamhost, 1&1, HostGator, and Network Solutions. Popular cloud-based hosting options include Nodejitsu (PaaS), Heroku (PaaS), Amazon Web Services (IaaS), Microsoft Azure (IaaS), and Digital Ocean.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.22.51.241