Live data from Hacker News

Ask HN: how to push to a live site?

news.ycombinator.com

1–10 of 16 posts

Ask HN: how to push to a live site?

#1
So I've read a fair amount of books and links on the internet describing how to scale stuff. Something I haven't come across are general strategies on pushing to a live CRUD site without taking it down. Can anyone point me to resources that I've missed, or perhaps just tell me?

Re: Ask HN: how to push to a live site?

#2
Could you define "push"? If it what I think you mean, you may want to check out some of the deployment chapters in the documentation of rails, django and other frameworks. They're usually not too bad at explaining how to get from dev to live.

SVN also has some documentation on their site, and I imagine git would have something similar.

Re: Ask HN: how to push to a live site?

#4
If you happen to be using Ruby, then Capistrano (http://www.capify.org/) is awesome.

I imagine there are similar solutions for other languages.

Worst case scenario, you can roll your own. A very basic trick is to use symbolic links on your server - deploy the site to a new folder, and simply point the symbolic link to the new folder when you're done.

Re: Ask HN: how to push to a live site?

#5
post #4

If you happen to be using Ruby, then Capistrano ( http://www.capify.org/ ) is awesome. I imagine there are similar solutions for other languages. Worst case scenario, you can roll your own. A very basic trick is to use symbolic links on your server - deploy the site to a new folder, and simply point the symbolic link to the new folder when you're done.

Capistrano works great for non-Ruby sites too! Our site is in PHP and it was easy to get cap working for us. We also use github.com so the site essentially pulls from there, which means we can also rollback in case we ever need to.

Re: Ask HN: how to push to a live site?

#7
Approach 1)

A long time ago I worked (in a very small testing capacity) at a very large video/streaming media serving company.

As I recall, the scripted procedure was to tag a release in CVS, and a script would pull that down into a new directory and swing the symlink.

This site had a very mature and infrequently changing billing system code path, which I believe was not modified in this process. If this doesn't describe your workload you would probably have to change this to support concurrent execution of multiple versions for people who have a session established

Approach 2)

Using any mainstream hardware load balancer (or presumably a similarly featureful free/open software LB), configure it to point at N+1 machines in a cluster. Administratively remove machines from the new session pool one at a time (virtual machines can make this flexible and easy to roll back). Once the established sessions have expired or been forced out, upgrade the software and roll them back in.

One neat aspect of this approach is if you have an "oh shit" hockey stick scaling issue, you can watch it happen on one machine before deploying it to every machine in your cluster. Also good for A/B testing, as mentioned in recent articles here.

Re: Ask HN: how to push to a live site?

#8

Using lisp if you have a network based REPL you can modify the running code live without taking the site down.

We push code changes with Git to the cloud, then log into the server and git pull. Then we use the repl on the cloud server to reload the code causing a recompile of changed code including dependencies. Strangely enough, the site continues to function during the recompile, which usually completes in less than a minute depending on how many macros are effected by the change.

Re: Ask HN: how to push to a live site?

#9
post #5
post #4

If you happen to be using Ruby, then Capistrano ( http://www.capify.org/ ) is awesome. I imagine there are similar solutions for other languages. Worst case scenario, you can roll your own. A very basic trick is to use symbolic links on your server - deploy the site to a new folder, and simply point the symbolic link to the new folder when you're done.

Capistrano works great for non-Ruby sites too! Our site is in PHP and it was easy to get cap working for us. We also use github.com so the site essentially pulls from there, which means we can also rollback in case we ever need to.

Concur, I looked a loooong time for something better then home grown solutions.

Capistrano is great. I've used it to great success deploying Django(Python) apps to complex environments.

Post reply on HN