D-Nice
D-Nice

Reputation: 4870

Setting up a continuous deployment environment for efficient scaling

I'm nearly ready to launch my rails app, which I have been testing using a single linode box. My git repo is also currently hosted on the same box, which also includes the application and the database. I want to split these into 3 entities -- a database server, and application server (with the option to easily add more), and a repo hosted on bitbucket.

Ideally, I'd like to be able to commit my code to bitbucket, and then setup a post-commit hook push POSTS to the app server to pull new changes from the repo and automatically start serving them. I've spent a whole lot of time reading about Puppet, Chef, Passenger, etc and I'm pretty overwhelmed. My setup is working fine as is, but I know that it won't scale well when the time comes, so I need to make a switch. What I'd like help with is determining what tools I ought to be using in addition to what I already have setup in order to make the process as smooth as possible.

Thanks

Upvotes: 0

Views: 771

Answers (2)

marko
marko

Reputation: 1217

The first thing that I would do is move the git repository to GitHub (or BitBucket, although I find it inferior).

Unless you app is going to be a smash hit, a Linode for production will serve you just fine. Remember that you can upgrade to larger instances without breaking anything in your setup.

I would not recommend spending time splitting up the app into multiple servers before you have any users, especially if you're still not yet proficient with basic tools that you've mentioned.

You could also move your app to Heroku. Have one instance as a staging server, another as production. It will scale indefinitely and you won't need to worry about automatic provisioning and security. Your app will up and running very fast, which is most important.

It wouldn't be so bad if you'd set up a production server on Linode with a non-automated, manual procedure too. You'll learn a lot during the process. It's up to you, although I'd recommend starting with Heroku by default. If over time you find something on Heroku that is limiting for your app, it'll probably be in time when your app is maturing and (hopefully) profitable, so it will be a good time to roll up your sleeves and manage your own hardware.

I would also not recommend doing deployment on every push to the repository. You definitely need to at least make sure that all your tests are passing (you are writing tests right?). A continuous integration server can run them automatically for you whenever you push to the repo. I can recommend Semaphore for that purpose.

Note that if you're on Heroku, deployment is just one git push from your terminal.

Upvotes: 1

axsuul
axsuul

Reputation: 7480

The chef route would be the best but the learning curve for that is steep. Would you consider using EC2? If so, there's this gem which helps you provision (which is similar to Chef, Puppet) and deploy to EC2. You can setup different roles and it also uses Capistrano. https://github.com/wr0ngway/rubber

For me personally, I have vagrant boxes for my development and staging environments. Chef helps me provision/install software on them with one command, including my production servers. From my development environment, I can deploy my code to my staging and production environments using Capistrano from a git repo on bitbucket.

Upvotes: 0

Related Questions