Friday, August 10, 2012

seamless - always up services in 85 lines of Go

At work we're debating on how to upgrade servers that need to be up all the time. This prompted me to write seamless.

It's a 1 to 1 TCP proxy which lets you switch the backend via an HTTP interface (on a different port than the one being proxied).

Typical workflow will be:
  • Start backend on internal port
  • Start seamless and proxy exposed port to backend
  • When upgrading start new backend on different external port
  • Tell seamless to switch backends
You can install seamless by running:
    go install bitbucket.org/tebeka/seamless

or if you don't have the go runtime, you can download the binaries.
All the code (inspired by Roger Peppe) is just 72 85 lines.
/* MIKI: Analytics */