I was curious if there are any solutions to deploying a go server without the need shut it down and relaunch it. I know popular solutions like ASP.Net and PHP and the like will do this seamlessly for user sessions.
Will stateless sessions take care of this issue?
This kind of seemless deployment can be achieved for even the most naive of application servers by introducing a request router such as nginx or haproxy. Both of these routers allow you to forward requests to different services (known as a reverse-proxy), and reload their configuration without dropping connections. By way of an example:
0.0.0.0.80
and forward these requests to 127.0.0.1:5001
.127.0.0.1:5001
.127.0.0.1:5002
.127.0.0.1:5002
. Then tell the router to reload its configuration.This is a simplified, high-level overview. (You should prefer unix sockets over the loopback interface, for example.) This kind of deployment is typically referred to as a canary or blue-green deployment.