Hacker News new | ask | show | jobs
by shykes 4988 days ago
Here's how I do it:

  $ pip install dotcloud
  $ echo 'frontend: {"type": "nodejs"}' >> dotcloud.yml
  $ echo 'db: {"type": "mongodb"}' >> dotcloud.yml
  $ dotcloud push $MYAPP
  $ dotloud scale $MYAPP frontend=3 db=3
This will deploy my nodejs app across 3 AZs and setup load-balancing to them, deploy a Mongo replicaset across 3 AZs, setup authentication, and inject connection strings into the app's environment. It's also way cheaper than AWS.

The only difference with OP's setup is that the Mongo ports are publicly accessible. This means authentication is the only thing standing between you and an attacker (and maybe the need to find your particular tcp port among a couple million others in dotCloud's pool).

(disclaimer, I work at dotCloud)

3 comments

"It's also way cheaper than AWS."

3 AWS Small instances cost under $200 / mo and come with 1.7GB of RAM each.

The dotCloud pricing calculator is coming up with $700 / mo for 3 mongodb instances with 1.7GB of RAM.

Obviously this isn't an apples to apples comparison. But How are dotCloud instances different from AWS instances?

It's cheaper at equivalent level of best practice:

* For a clean architecture you want to isolate each Mongo and node process in its own system. So you need 6 instances, not 3.

* You'll need load-balancers in front of these node instances. That costs extra on AWS, and is included on dotCloud.

* Did you include the cost of bandwidth and disk IO in your estimate? Those are extra on AWS, but included on dotCloud.

* Monitoring is extra on AWS. It's included on dotCloud.

* I love to have a sandbox version of my entire stack, with the exact same setup but separate from production. That's an extra 2 instances on AWS (+io +bandwidth +load-balancing +monitoring). It's free on dotCloud, and I can create unlimited numbers of sandboxes which is killer for team development: 1 sandbox per developer!

* We only charge for ram usable by your application and database. AWS charges for server memory - including the overhead of the system and the various daemons you'll need to run.

* For small apps specifically, you can allocate memory in much smaller increments on dotCloud, which means you can start at a lower price-point: the smallest increment is 32MB.

I didn't even get into the real value-add of dotCloud: all the work you won't have to do, including security upgrades, centralized log collection, waking up at 4am to check on broken EBS volumes, dealing with AWS support (which is truly the most horrible support in the World, and we pay them a lot of money).

+ Our support team is awesome and might even fix a bug in your own code if you're lucky :)

Recommendation is to validate "best practice" claims. Doesn't matter what hosting solution used. Measure, measure, measure to make sure not only are you getting said claim but also that the end result meets your expectations. An example is in the past I had 7 "instances" (as shykes points out make sure they are hosted on separate nodes!) 4 of which where load balances Python web app. One of the nodes was overloaded so 1 out of 4 requests was very slow (5-10x). This was a big ajax app so initial page load would hang on the request(s) to that one instance. My point was since I had measured I could see that the node was the problem and now that I am on dedicated EC2 each node is consistant. Good luck.
That's good advice. As the saying goes: "trust, but verify".

Regarding your performance issue - most platforms (including dotCloud) enforce ram and cpu separation between nodes, but are vulnerable to IO contention at some level. This is also true for EC2 if you use EBS: your standalone instances will almost certainly, at some point, suffer from degraded and inconsistent performance because another instance is competing for IOPS [1].

You can avoid this with the new "provisioned IOPS" volumes [2], or by skipping EBS altogether for stateless components.

[1] http://blog.scalyr.com/2012/10/16/a-systematic-look-at-ec2-i...

[2] http://aws.amazon.com/about-aws/whats-new/2012/07/31/announc...

This seems ridiculously nice to me, but I haven't heard much buzz around this in the community. Any thoughts on why there's comparatively less noise about dotCloud's offering? It seems far nicer in many ways than others.

From what I remember when trying to get the copy/paste instructions written for Kandan so others could deploy to dotCloud to get started with it, there was a steeper learning curve for dotCloud than for other services (with the possible exception of CloudFoundry, which was a sunk cost for us at that point anyway...). Maybe the on-boarding is a bit tough for new users? Where do you see the most significant drop-off in your funnel? If you don't mind sharing, of course.

> This seems ridiculously nice to me, but I haven't heard much buzz around this in the community. Any thoughts on why there's comparatively less noise about dotCloud's offering? It seems far nicer in many ways than others.

I think there are 2 reasons.

One reason is simply that we're better at building the product than the buzz. As it turns out "developer buzz" is not organic, it is something that must be engineered, like any other feature of the product. There are people who specialize in crafting and projecting an image of success in a way that appears authentic. It is a difficult and highly specialized, not to mention it involves a fair amount of "fact distorsion" that doesn't appeal to us.

The second reason is that we're successful without it. When you and I say "developer buzz" we usually mean "HN-reading bleeding edge developer buzz", but 99.999% of our addressable market doesn't read HN. We crave our peer's appreciation and respect as much as everyone else - but at the end of the day, that's not what pays the bills. In our case, mid-aged developers and IT managers looking to remain competitive while circumventing office politics to get their development server in 6 weeks instead of 8 - that's what pays the bills.

Sounds reasonable, very cool. I suspected it was something along those lines - a demographic that had money (and real problems) that I wasn't personally connected to.
I was interested, I digged into your docs : no postgresql scaling :(