1

I noticed yesterday that there was a new navigation bar on top of this site. And it has also added more features on the nav bar that definately requires server side changes or at least newer queries.

Yes it has ver attached to the css as a variable so that a fresh copy is loaded each visit. I want to know how do they complete the changes i.e. swapping of files without any downtime?

Perhaps there are loads of other things that go on in the back any insight would be good. Thanks.

Abu Nooh
  • 846
  • 4
  • 12
  • 42
  • Well for starters they don't have just one front-end server. ;) – Dimitar Dimitrov Dec 05 '13 at 11:46
  • I would imagine StackOverflow is served from many different servers, if one happens to be uncontactable at any point in time the request would get served by another. That being said a small change like so should take few file changes in a well designed system and I can't imagine any requests would get denied by the server whilst overwriting a few files. – George Reith Dec 05 '13 at 11:49

2 Answers2

2

Although I don't think this question belongs in StackOverflow, I have some experience about changing a running website.

We had 3 different servers: Development, Stage, Production. We did all the development in development server. Then when we decided to migrate, we copied public_html folder with a different name to the same folder that current public_html resides in. Then we would swap names of the folders and, voila. We had a script that did that automatically: Pull from git, swap names.

We tested the script on stage server and if it didn't fail, we applied the same to the production server.

You can also change apache config to look for your new folder. Think of it as 'double buffering', old site is a buffer. The new site is loaded into a new buffer, then apache configuration is changed so that the new folder is used, ie. the buffers are swapped.

Swapping names is no big deal and I didn't experience any bad side effects to this method. But I guess changing apache config is a better idea.

holgac
  • 1,509
  • 1
  • 13
  • 25
0

Well nobody knows how they really do it but what we do:

Use a staging server where your whole website is duplicated. Make all your changes there without nobody knowing what's happening as the website is provided by another server. And then just change your domain configuration so that the staging server becomes the new webserver and the other way arround.

Ria Weyprecht
  • 1,275
  • 9
  • 19