What the hell are Atomic Deployments, I hear you ask? Good question and I have recently asked the same question myself. The answer is much simpler to explain and perhaps you are already intimately familiar with the process.

The strategy is to employ a deployment pattern which uploads a fresh copy of the website to a folder neighbouring the webroot. This means that whilst we wait for the files to transfer the live site continues to work from the existing files. When the deployment is completed we use Symlinks to redirect the webroot to the new files.

Atomic Deployment Folder Structure

Your web server will always point to the same Symlink folder, usually called current. The Symlink reference can be updated up point to new versions, or even back to old versions if you need to roll back. All your versions are usually stored in a folder called releases, each with a name matching the deployment timestamp (i.e. 202212302330).

Atomic Deployment Release Folders

To keep disc space usage small we also utilise another Symlink folder called shared. This contains the same folder structure as your webroot and is purely for user files like the uploads folder. Basically stuff that will always be the same regardless of the release.

DeployHQ have implemented the Atomic Deployment pattern as an option if you have full SSH access to your server. Once enabled it fully handles all the transferring of files and timing of Symlink changes. As a one-click deployment it’s a really nice feature.

New money for an old idea?

But – haven’t we been doing a version of this since the beginning of time?

The first rule of Deployment Club: always take a backup before you deploy or make a change. Better yet keep a copy of the current version and deploy to a new folder, then point the web server to the new folder. Sure, this was originally a lot of copying and updating the server root was manual too, but just because someone has now automated the process doesn’t mean it’s new tech, does it?

Perhaps this is an opportunity for those of us who have been in the web development game for a little longer to club together and agree that we can each claim a tried and tested idea. Then we can give it a cool name, give it a little polish and sell it to the masses as the latest trend?

Posted by:Joseph D'Souza

I'm Joseph D'Souza, an experienced .NET developer with a speciality in Umbraco and WordPress development. I'm proud to be the Director of Alpha Labs, a leading web development firm based in High Wycombe. Also, a happy family man with a loving wife and two beautiful children.

Leave a Reply

Your email address will not be published. Required fields are marked *