Using multiple Netbox frontends with a single PostgreSQL database #14413
-
I need to run 2 Netboxes that are connected to the same PostgreSQL DB (single source of truth). I have installed a similar setup on my laptop and it is working (same DATABASE, SECRET_KEY settings in configuration.py). I am concerned about the stability of this solution in write mode. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Sharing the postgres database absolutely fine. Indeed, this is how it works in single-server operation, where you have multiple gunicorn worker processes and/or threads. When doing this, you should share the Redis cache as well. However, the fundamental problem you will have is that there are many cases where the database schema changes between versions. Therefore in general you can't test a new version alongside running an old version using the same database. The solution is to clone the production database, copy it to the test server, and then apply the schema changes there (run For patch versions (e.g. 3.6.1 -> 3.6.2) often there is no schema change, in which case it will be fine to run both in parallel, but in my experience such changes are primarily bugfixes and rarely cause problems, so the benefit of such testing is minimal. |
Beta Was this translation helpful? Give feedback.
Sharing the postgres database absolutely fine. Indeed, this is how it works in single-server operation, where you have multiple gunicorn worker processes and/or threads.
When doing this, you should share the Redis cache as well.
However, the fundamental problem you will have is that there are many cases where the database schema changes between versions. Therefore in general you can't test a new version alongside running an old version using the same database.
The solution is to clone the production database, copy it to the test server, and t…