Deploying Node.js on Amazon EC2
blog.carbonfive.com
blog.carbonfive.com
It would be interesting to know what kind of experiences other people have had with the various Node.js platforms.
By contrast, I've set up my first Rackspace Cloud VPS a few months ago and the install was a few clicks followed by them emailing me the SSH connection info. I'm not making any claims about the serviceability of one product over another, but the "I just want to try it out" story for Rackspace ca. July '11 was far better than EC2 ca. September '10.
Edit: I was also put off by the many meters of EC2 pricing... I never really knew ahead of time what costs I was going to incur. With Rackspace it was easy for me to calculate $10/mo. for a single Ubuntu box. Perhaps I missed a tool on EC2 that I should've known about?
Launching an instance takes < 30 seconds and is a matter of a few clicks, the author of this post chose to use an external AMI which makes things a bit trickier and entails a few extra steps.
The management console is okay if you just want an instance or two, but it still strikes me that AWS is best when you want (or need) to automate allocation of cloud services. Libraries like Python's Boto are great way to get the basics taken care of, like working with S3 and spinning up/shutting down EC2 instances, without having to fret too much about the raw AWS APIs.
Beyond the basics, it's quite common to want to spin up a web of resources (EBS, load balancers, security groups, elastic IPs) along with new EC2 instances. The console isn't ideal for that, but Cloud Formation is fairly good: CFN allows you declare the resources you want and their relationship to one other. Construction is transactional, so you either get a working web or you get nothing. The Cloud Formation syntax is JSON and a little wonky -- there are things like functions to do table lookups so you have some semblance of making choices -- but it's serviceable.
(For sanity we use YAML for Cloud Formation and convert to JSON before sending it up to AWS. JSON lacks comments and sucks to hand-edit on deeply nested structures. Some of our YAML is hand-written; some of it generated by our Fabric scripts.)
http://devcenter.heroku.com/articles/node-js
You have to use an add-on for Mongo, but it's easy to configure that from the Heroku app dashboard. Overall, I have been pleased thus far. The one gotcha I ran into was that you have to define the port the app will listen on as process.env.PORT as opposed to your own port. Thus, assuming you are using express, the line is:
app.listen(process.env.PORT || YOUR LOCAL DEV PORT);
"-----> Compiled slug size is 3.2MB"
It takes 3.2MB to say "Hello World!" on Heroku using Node.js?
that's basically Rails
The best part about using Heroku for NodeJS apps is that I can focus more on writing my app code and less on sysadmin-related tasks. I don't have to worry very much about provisioning or scaling ("heroku scale web=2" tadaaa).
The downsides include cost (this depends on a variety of factors of course, e.g. what 3rd party plugins you're using) and lack of "control" (if you care about that sort of thing). Also, they don't support WebSockets (yet).
<self-promotion-warning> My Node Knockout app is running nodejs/mongo/redis/socket.io (resorting to long-polling since Heroku doesn't support Websockets, but it's quick enough): http://restalytics.com (sorry, the home page is kinda busted, but scroll down to the bottom and log in with nkodemo@restalytics.com/nkodemo if you'd like to see a working demo. Modern browsers only). </self-promotion-warning>
Edit: I'm linking to my app to show you an example of a working NodeJS app on Heroku, but I've wrapped it in a self-promotion-warning regardless to preemptively fend off any downvotes that I might get as a result of people misunderstanding my intentions.
Edit2: Full disclosure, I happen to work at Salesforce.com.