Battle of the PaaS: Node.js Apps in the Cloud
No matter why you came to Node.js to develop your app, what you want to know now is the best place to host it. The answer to that question, though, really depends on what you want to do when you get to the cloud—which involves your original intent for the app. So, let's explore some PaaS options...
Join the DZone community and get the full member experience.Join For Free
No matter why you came to Node.js to develop your app (blasting past slow I/O, free data exchange, moving out of the Flash sandbox, etc.) what you want to know now is the best place to host it. The answer to that question, though, really depends on what you want to do when you get to the cloud—which involves your original intent for the app.
Unless you have your own IT department, PaaS beats self-hosting in a variety of ways. Your app will be able to handle surges in traffic inside data centers that are high-powered and geographically distributed. PaaS comes pre-built with all of the programming languages, frameworks, libraries, services, and tools that your app is going to need as it grows and evolves. Before we get there, though, we should review some of the issues around how a typical Node.js app is deployed.
Getting Ready for Deployment
Many developers use tools like Node Package Manager to get their packages ready for deployment. On the other hand, if you end up deciding on a PaaS like Heroku, go directly to the PaaS deployment support site (for example, take a look at Heroku Dev Center) to get step-by-step instructions for getting your app up and running, along with any advanced features you may need to access.
Top PaaS Destinations for Your Apps
Heroku has a well-deserved reputation for making deployment easy, as you may have seen if you went to the above link to their dev center. It was built by Ruby developers for Ruby developers, but this has proven to be just as useful for Node.js apps. Although a good choice for beginning developers, Heroku has also been chosen for its simplicity in hosting larger commercial projects like Faces of NY Fashion Week and National VIP.
- 24 hour monitoring. You have professional status monitoring, including a frequently updated Status Site.
- Low cost to start. You can use Heroku for free at the entry level with 512 MB RAM and one web for one worker.
- Portability. It uses standard tools, so it is easy to pack up and move to another host if necessary.
- Integration. You can use Heroku with several third parties, such as MongoDB and Redis.
- Popularity. Heroku lists Macy’s and MalwareBytes among its users, as well as several smaller companies. Its popularity also means that there’s a broad range of supported plugins to choose from.
- Lack of control. The simplicity comes at the cost of freedom to select the precise configurations such as hardware, OS, and firewall.
- Steep price jump. When you are ready to move up to the professional level of support, the costs can be much higher than the competition.
- Limited performance. The fact that it was designed for Ruby on Rails means that Node.js apps can show performance strains.
Heroku is the best choice for beginner Node.js developers and those who want to get online fast with ample support. Many open-source advocates around the world swear by Heroku. It is pretty common to deploy to Heroku, and once the app begins to get serious traffic, migrate to a PaaS with more freedom
Modulus is the new name of Nodejitsu, one of the more popular PaaS solutions on the market and built specifically to support Node.js apps. In 2015, Nodejitsu was bought out by domain provider GoDaddy, and transformed into Modulus. Modulus has become more popular among startups such as Habitat and iChamp.
- Excellent Support. Modulus understands that building a loyal customer base takes time and dedication. There are several ways to contact support, and user reviews consider them to be very helpful.
- Automatic Scaling. For those of you who mainly want to focus on the bare-bones building process, Modulus provides auto-scaling – one less thing to worry about during the day-to-day management of your app. For those who like a little more control, this feature is entirely optional.
- Simplicity. Modulus is incredibly easy to use and is, therefore, suitable for absolute beginners. They have an app of their own which allows users to track statistics and manage their app on-the-go.
- Price. Unlike other PaaS solutions, Modulus has no free tier. At the very minimum (1GB file storage, 64MB database, 1 server) you will still be paying $7.20 per month. However, the higher data bands are not overpriced, and there is a free trial available (although it does not last long).
- Smaller user base for support. Unlike its predecessor Nodejitsu, Modulus suffers from a lack of third-party integration, and there’s not a large user base to turn to for support and innovation.
Modulus is another good PaaS for start-ups and beginning developers. They have excellent customer support, a simple interface, and very few issues, which would make them a great choice to those of us who are only dipping our feet into the PaaS world–if it were not for the sheer cost of their services. A big draw of using a PaaS is that you are usually spending less money on hosting, and yet, with no free tier, Modulus is the most expensive option featured on this list. It is up to you whether you think the significant 'pros' of using Modulus are worth it.
3. Microsoft Azure
Many developers tend to shy away from Microsoft due to the portability issues, but Azure is a solid PaaS offering with plenty of functionality. The Azure’s site points out that more than 66 percent of Fortune 500 companies, 10,000 customers per week, rely on their 22 regional data centers for app hosting.
- Pay-as-you-use pricing. Microsoft Azure offers three different payment plans, each one tailored to the user’s needs. The basic app service is free.
- Microsoft Azure works with other Microsoft services such as Visual Studio and WebMatrix.
- Security. Microsoft Azure takes security very seriously. It uses penetration testing and even offers that same service to its customers. It also uses in-house security, instead of relying on Amazon Web Services.
- Scale and performance. Microsoft Azure works with a specific set of runtime libraries, which creates excellent scaling and performance. However, this does create a risk of lock-in.
- Dealing with Windows. You’ll need to ensure you use npm install for all dependencies in case you need to compile C code on Linux, Mac, or Windows since you can’t transfer a precompiled binary from one OS/architecture to another.
- Risk of 'lock-in.' Microsoft Azure requires tailoring your code to the PaaS, which means that migration to another PaaS can be difficult.
- Poor support. Despite their popularity, Microsoft Azure is lacking in the support department. Users report that getting hold of support was challenging, and the documentation provided is over two years old.
Microsoft Azure is best for large-scale projects. It has advantages in terms of pricing, security, and functionality. However, it comes at the price of being difficult to migrate in from other OS environments and out to other PaaS options. You might be concerned about the level of support if you a developer new to the Node.js environment.
Linux users have been significant supporters of Linode for more than a decade. It has seen a good deal of upgrades and developments in the past couple of years, so it is a reliable choice. Linode features a hub of high-performance SSD Linux servers for variable coverage of infrastructure requirements. They now offer a 40-gigabit network with Intel E5 Processors and support for Ipv6.
- Active development. Linode recently added features like the Longview server monitoring. It is capabilities are evolving rapidly.
- Linux user base. The community of Node.js developers is supported by a wider community of Linux users who can troubleshoot most issues you encounter.
- Free upgrades. The base level has been upgraded to offer 1GB ram, 48GB storage, and 2TB transfer. Long-time users will see their capabilities grow with regular upgrades.
- Server attacks. Last Christmas, Linode was plagued with DDoS attacks. While it was not their fault, their reputation suffered for it. Linode managers blamed the size of the data center as one reason for it being an attractive target.
- No control panel. You have to configure your own virtual hosting. You will not be able to run CPanel or Plesk, so you have to be pretty comfortable with command line controls.
Linode devotees tend to be pretty enthusiastic about it. If you are an experienced developer and want the support of a robust Linux community that goes beyond development, this is an excellent destination for your apps. Be aware that they may continue to be a target for hackers, but you can enjoy watching the latest technologies evolve on their servers.
If you are a beginning developer or a startup, go with Heroku or Modulus. If cost or portability is a concern, start with Heroku.
If you are working in a team on a larger, collaborative project, particularly on Windows machines, Microsoft Azure is extensive enough to handle just about anything you can create.
If you are an advanced Linux aficionado with a deep interest in testing out the bounds of new technology as it appears, go with Linode.
Published at DZone with permission of , DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.