3 ms·
> ... deploying Node is much easier. If you want to be really quick and deploy to the cloud, take AWS and you are done in 13 steps: Those 13 steps were about c
by rpwilcox 14y ago
> ... deploying Node is much easier. If you want to be really quick and deploy to the cloud, take AWS and you are done in 13 steps:
Those 13 steps were about compiling node, not about serving node.
Serving node is more complex. The real steps in hosting node:
1. Step up node environment. (explained in the "13 steps blog entry")
2. Make sure your node app handles exceptions and doesn't just die when something goes wrong (aka: "don't use the built-in one line http start server line")
3. Install monit/munin/god/upstart/whatever-else to restart your node servers if they die
4. Set up cluster or node.js's built-in new cluster API
5. Set up a load balancer, just in case you have performance issues in your app and you end up doing bigger work than you think you do, or have more traffic than you planned for
6. Set up database, potentially worrying about scaling issues there
7. Deployment and version rollback system, and dealing with the servers when you deploy code (need to restart them?).
8. DDOS defense.
I can see why you would want an automated PaaS to take care of all these things for you.
I see two target markets for node.js:
1. "Hey, you know Javascript, now you can write server side code too!"
2. "Hey, server side guy, hate how hard it is to do async programming in Ruby/Python (because the majority of the libraries are synchronous?) Javascript can be used on the server and doesn't have that synchronous baggage!"
The second target market certainly knows about all these 8 things I listed, but the first might want/need a managed host.
- tferris 14y agoGood post! Ad 2.: Ok, that's right but rather a general prerequisite, so I would remove it from the list. Ad 3.: Yes, this is recommended. 4. and 5. are good steps but optional and should be done in later stages otherwise it's typical premature optimization 6. Optional you could use hosted solution like MongoHQ 7. Just install and use Git?? 8. DDOS defense? There's no standard recipe > I can see why you would want an automated PaaS to take care of all these things for you. I agree with you that automated hosting is nice but somehow the bizmodel doesn't seem to appeal. But again, compare this to the Rails world: How many automated hosters do you see there? Not many more.
- rpwilcox 14y ago> 7. Just install and use Git?? I made that point generic for a reason. :) So you git push to your remote, now you (may) have to tell the servers to reload. Along with other things (database migrations if you're using SQL, compiling native code if you have any of that, potentially updating configuration files if your app needs that, updating assets on a CDN/cache etc). Yes, sure, a post-receive hook can be wired to do these things, but you have to know that and do the wiring.
- mmobile 14y agoHow is this post receive hook done ideally with Node and Git?