Vertical Scaling

Vertical scaling, or "scaling up," boils down to adding more resources to a single server to increase its capacity. This is often the simplest way to handle increased load, as it doesn’t require changes to the application’s architecture.

Scaling up can be achieved in several ways. The most direct method is upgrading the server’s hardware. In TypeDB Cloud this can be handled by migrating the cluster to a larger machine size.

Threading model

TypeDB’s query model is currently optimized for being efficient and lightweight. Each query runs single-threaded, so utilizing more CPU and memory resource is best achieved through many concurrent queries and transactions.

Planned work will enable concurrent execution within 1 query and provide major performance improvements when increasing machine size and executing individual queries.

Memory model

The primary consumers of memory in TypeDB are RocksDB (defaults to 1 GB of cache per database in the server), plus working memory buffers per transaction. Any writes submitted to a transaction are buffered in memory until commit, so keeping transactions relatively small (100-1000 queries) is optimal.

In addition, to maintain performance we recommend that at least 5% of your data size fits in memory, to ensure indexes are easily accessible and speed up querying.

Disk space

To support higher-level operations and excellent ad-hoc querying, TypeDB automatically builds additional indexes according to the user’s schema. This normally account for a 20-25% overhead in disk space compare to alternative databases. Keep this in mind when provisioning disk size.