4

Can TerminusDB run in a multi-server environment?

  • Either with a Sharded and Clustered database mode
  • Or can it run on Distributed database scheme?
  • Or it can only run as a single process and does not horizontally scale?

If it can scale horizontally, how?

Erik Kaplun
  • 37,128
  • 15
  • 99
  • 111
quarks
  • 33,478
  • 73
  • 290
  • 513

1 Answers1

4

You can run multiple TerminusDB instances that use the same store, by using a distributed file system that supports at least optional locking. This is the case for NFS4 and many other distributed POSIX file systems. It may also work on windows shares (SMB), but this is currently untested. Besides pointing at the correct storage directory on each server (using the TERMINUSDB_SERVER_DB_PATH environment variable or by starting the server in the appropriate directory to allow auto-discovery), no extra setup has to be done to make this work.

TerminusDB does not support sharding. To use a database, each server instance needs to load in that full database into memory, so there's nothing gained by horizontally scaling if your goal is to reduce the memory footprint of individual instances.

Using multiple TerminusDB instances will help you though if you want to increase query throughput, as you can just round-robin requests to a server pool. This will be especially beneficial for read-heavy workloads.

matko
  • 134
  • 6
  • Hi, so if I have a DB that is already 1 TB in size does it mean that for each TerminusDB instance/process it will need 1 TB of physical or virtual RAM? – quarks Mar 21 '21 at 00:54
  • Yes. Each instance needs to load the whole database, so the whole 1TB. There is no sharding. – matko Mar 21 '21 at 00:56
  • What will happen if the database is so big and there's not enough RAM? – quarks Mar 21 '21 at 00:58
  • There's currently no safeguards in place to stop you from loading too much. What will happen is that TerminusDB will use any swap memory that is available, and once it has exhausted it all, the process will crash with an out of memory error. That is obviously not great, and we need to be better about that, but that is how it is now. – matko Mar 21 '21 at 01:12