PostgreSQL and high availability
By default each module keeps its data in a SQLite file - fine for one server. For larger installations and several servers use PostgreSQL 13 or later.
- Create the database:
CREATE ROLE viswca LOGIN PASSWORD '...'; CREATE DATABASE viswca OWNER viswca; - Move your data (service stopped):
Keep the SQLite files as a backup.VISWCA_DB_URL=postgresql://viswca:PASSWORD@dbhost:5432/viswca ./run_server.bin --migrate-to-postgres - Start every server with the same
VISWCA_DB_URL,SECRET_KEYandVISWCA_DATA_KEY(copysecret.key/data.keyfrom the first server) and a uniqueVISWCA_NODE_NAME. - Load balancer: health check
GET /healthz(200 = this server can reach the database; the answer shows leader or standby). Sticky sessions are not needed.
- Scheduled jobs run on one server only (the leader). If it stops, another takes over within 10-20 seconds.
- Simultaneous actions on the same item (two approvers, double clicks, two servers) are serialised - exactly one wins.
- Each server keeps
VISWCA_DB_POOL(default 32) connections open. Set PostgreSQLmax_connectionsto at least servers × (pool + 5) plus headroom. - Put
uploads/on shared storage (NFS, SMB, EFS) mounted on every server.
