Can bitwarden_rs tolerate being clustered?

Level 1:

Will it’s implementation tolerate having two or more instances running against same database (mariadb) for failover purposes, with only a single instance actively serving users (though both running) at same time?

Level 2:

Are it’s internal operations of the server stateless outside of backend database, such that it could tolerate being hit from multiple container instances at the same time? (Assume round-robin or without-warning failover between nodes.)

In both cases, key question is whether any in-memory state is maintained that could be corrupted by having two containers running at same time against same DB?

Found this, so looks like that answers my question:

My answer on that post you refer to still applies.
So, in short, yes it could work with some caveats to keep in mind.

  • Attachments probably need to be on some shared storage. (Same goes for icons etc…)
  • The rsa key’s used for the JWT need to be shared.
  • Websockets will not work fully if using round-robin.
2 Likes