We are leaning on n8n more and more (it’s a fantastic product) but we want to make sure we have high availability in the event a server or datacenter goes down.
Ideally, we’d like to have an instance of n8n running in two of the datacenters we have a presence in. Right now, we run in regular mode but we may run n8n in queue mode as the demand grows.
Our current idea is just to do MySQL replication between our main instance and the backup instance. The other instance would not have n8n running (we use pm2) but would have the environment config set up and ready in the event we need to failover to it. That way all we would need to do is start n8n on the failover instance and update DNS in the event of an outage.
Is this a feasible way to replicate data and provide some failover ability? Any caveats that we should be aware of?
That will do the job, There could be issues with binary data if using the file mode and if you are running in queue mode you also have the Redis component to think about as well.
Oddly I think this same sort of question has come up 3 or 4 times this week which is good to see and might mean we should create some documentation on it and give it a test.
The filesystem method might be better and you could replicate that as well although chances are if you are downloading files and the workflow fails you would need to rerun the workflow anyway.