RocksDB to store data on disk. RocksDB is a high performance embedded database for key-value data. It is originally a fork of Google’s LevelDB optimized to exploit many CPU cores, and make efficient use of fast storage, such as solid-state drives and high-speed disk drives. It is based on a log-structured merge-tree data structure.
In distributed mode, SurrealDB can be configured to use TiKV to store data. TiKV is a highly scalable, low latency, and easy to use key-value datastore. TiKV supports raw and transaction-based querying with ACID compliance, and support for multiple concurrent readers and writers. The design of TiKV is inspired by distributed systems from Google, such as BigTable, Spanner, and Percolator, and some of the latest achievements in academia in recent years, such as the Raft consensus algorithm.
When running in a web browser, SurrealDB can be configured to use IndexedDB to store and persist data within the web browser. SurrealDB first serializes both keys and values into a Uint8Array, utilizing IndexedDB as a binary key-value store - offering good performance, and with the ability to offer all of the functionality and features that SurrealDB offers when running in alternative ways.
When you have deployed an HA cluster (High Availability), you will have a deployment that resembles the following configuration
The HA deployment of your storage layer (TiKV, or FoundationDB) is the stateful part of the system. The rules governing the availability guarantees are covered in the documentation of those systems. SurrealDB clusters do not have state at the time of writing. Any necessary communication is either avoided by design, or communicated via the storage layer which maintains consistency. This makes deploying SurrealDB really convenient, since your fault tolerance is equal to the number of replicas (minus 1, the bare minum number of instances). Even though we do have bootstrapping, by design nodes can come and go as they please without much interference.