aomran/curri

Deploy to Production

Closed this issue · 4 comments

We need to of course deploy the app to a production environment. The app needs the following:

  • app server to run the rails code
  • faye server to make the real-time features work (websocket stuff)
  • PostgreSQL database

If we use Heroku then we have two choices:

  1. We would need two Heroku apps running (one for the app & one for faye). We can "cheat" and ping the Heroku apps every 30 minutes or so with a service like monitor.us and that way avoid having to pay for the server. The free PostgreSQL database has a capacity for 10K rows. No idea how well this setup will hold and for how long.
  2. We pay for Heroku. An app will go idle unless it has two dynos. This means we need to pay $34.50 for the rails app and another $34.50 for the faye app. And a database with 10 Million row limit is an additional $9. So that's a total of $78/month.

If we want a less expensive alternative then we can use:

  • cloud66.com to deploy, manage and scale the app. $9/server/month
  • digitalocean.com as the private server. $5/month gives an equivalently sized server (probably better performance than Heroku). For $10 we can get one server that can handle both the app and faye.
  • So a total of $19/month.

Scaling

For new apps the order for scaling is:

  1. Scale the software (i.e. make it run more efficient)
  2. Scale vertically (i.e. make the server bigger)
  3. Scale horizontally (i.e. add additional servers)
    Reference: http://sevenoct.wordpress.com/2013/07/04/scaling-applications/

Scaling vertically (making the servers bigger) is very costly on Heroku and it's not really something they encourage. Digital Ocean on the other hand lets us grow the server size to pretty much whatever we want.

Any comments, suggestions, ideas?

I don't think we should pay for Heroku ATM. How about this flow:

  1. Free Heroku- stick with the free option for now w/a service like monitor.us or an option like new relic as suggested on this StackOverflow thread? Once we start getting traffic that justifies upgrading, we then go to:
  2. Digitalocean for $10/mo + $9/mo for cloud66, plus pay to scale horizontally or vertically as needed.

Unless, this will be too complicated with moving the PostgreSQL DB, and if you think about it- $19/mo is not expensive.

So I will leave it up to you and Paula to take a call, thinking about what the move from free Heroku to paid digitalocean/cloud66 combo might entail down the road. I'm OK with either option.

Have a good safe move!

If (paid) Heroku were significantly easier to deploy to, or there was another significant advantage, my recommendation would be Heroku first, work on more cost-efficient solutions when/as we have time to do so. If as per our discussion, the inexpensive alternative is fairly easy to start with, I would choose that, and stay there until/unless something else proves advantageous. I am not comfortable with the "cheat" option for a start-up that plans to be commercial.

Hey guys,

Heroku paid: $78 x 12 months is $936.

Heroku free: $0

Digital Ocean: $19 x 12 months is $228.

Unless you see a significant disadvantage to Digital Ocean / Cloud66, I would suggest this route. Cost wise, I think $19/ month seems quite manageable and we could start immediately if the advantages are justifiable.

But, if we only have HackerYou Alpha Testing and Ahmed will be on hand immediately if it goes down, does it make sense to go high cost yet?

I'm supportive of whatever Ahmed and Paula decide on this.

Well 11 commits later we have a production server now: http://squirrel.curri-app.c66.me/

Everything should be running smoothly. A single $10 virtual server is running Rails, Faye, and PostgreSQL. I also configured mandrill to send email, so invitation emails should go out.

Cloud66 has a 14 day trial so I didn't pay anything to get started. I also got a $5 credit for using a promotion code when I signed up for digitalocean.