Summary: How to setup a production server environment that can be updated (n8n and custom modules) with zero downtime?
We are investigating n8n and deciding if it can help solve the automation needs of our company. Most likely we will create our own custom module that contains custom nodes for various internal processes. But I can’t find documentation regarding a n8n production setup with one or more custom modules. Also updating n8n with no downtime is not discussed at all. If we’re going to use n8n we have to be able to update n8n and/or custom modules without downtime.
How can you setup n8n on multiple servers in order to perform “rolling updates”? It’s probably possible with Docker but I’m not a docker expert. We use AWS Elastic Beanstalk for this feature. With 2 servers, rolling updates and the load balancer, we can perform either a n8n update or a custom module update with no downtime.
As a general point of reference you probably want to have a look at our scaling documentation available here:
This is not a zero downtime strategy though and you might want to consider whether striving for it is worth the effort that comes with it. I was talking to @Jon about this and he shared this handy link: 99.999% Uptime: Ensuring 5 Nines Uptime - Stratus Technologies
Seeing that after pulling the respective docker image the upgrade process istelf consists of a simple container restart which is done in seconds, you could achieve five nines/a ~99.999% uptime already which would be considered continuous availability.
Having said that, you should in theory be able to route all traffic to main instance A while updating main instance B (using the same database and same volume), then re-route all traffic to your instance B once the upgrade is complete.