Using BitTorrent Sync to live edit or deploy websites

Hopelessly untested – a thought inspired by Stacey.

The idea is to use BitTorrent Sync (BtSync) to sync a local development directory to a live web server directory.

Two approaches spring to mind.

Approach 1: Live Edit

Local directory structure:

syncedsite/src/

Setup BtSync to sync syncedsite/src/.

Anything that is modified or added to the src directory will be taken live, almost as you type (well, save).

Approach 2: Deploy

Local directory structure:

syncedsite/dev/src/
syncedsite/live/src/

Setup BtSync to sync syncedsite/live/src/.

Develop and test locally in the dev/src directory. Once you’re done, move changes over to live/src to be instantaneously deployed.

Possible uses?

  • for the hobbyist web developer who maintains a simple or static site.
  • a shared host could offer this as a service.
  • for easing responsive site testing.

Final thoughts

Using the BtSync mobile app, you could edit a site “on the go”.

Although I haven’t put much thought into this, there may be security benefits to using BtSync over FTP or Rsync.

Finally the immediacy and hands-off aspects are just fun.

There are also problems with this approach – the type of user most likely to benefit from this setup may be unable to install BtSync on their live server (either due to lack of experience or access on a shared server).

It is very easy to delete and take down your entire site by accident – I would recommend adding a Git repository or some sort of backup.

I’m also not sure to what extent it might look like you are running a BitTorrent seed box from your live server (minus the huge traffic of course).

Read the comments at Hacker News.

4 thoughts on “Using BitTorrent Sync to live edit or deploy websites”

  1. I love BTSync, use it a lot. But I don’t see its advantage over, say, rsync for publishing.

    With publishing, you definitely want an explicit “Go!” button. A point at which you DECIDE to publish. You don’t just want this to happen automatically arbitrarily half-way through writing or editing something.

    Given that, rsync is fine. Just write a shell-script or similar encapsulating the call to rsync and the forgetable things like the path on the server. Then just run that when you need to publish.

    1. Hi Phil.

      Firing when ready syncing could be achieved with my suggested approach 2. ie. Copying everything over from a dev directory to a live directory when you’re ready.

      However I can’t shake my sense of glee at the idea of editing a local file and having it auto-magically update on the live server. It will probably wear off after a while.

      I do currently use a rsync script when updating the few WP sites I maintain and I am unlikely to change that, but for a very simple hand coded site I think this could be fun.

Leave a Reply

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