High-Performance for OLTP and OLAP Workloads

SingleStore is a highly-scalable distributed system. Data is sharded automatically amongst nodes in a cluster. Sharding optimizes query performance for both distributed aggregate queries and filtered queries with equality predicates. You can add nodes and redistribute shards (also known as partitions) as needed to scale your workload.

SingleStore also supports storing and processing data using an in-memory rowstore or a disk-based columnstore. The in-memory rowstore provides optimum real-time performance for transactional workloads. The disk-based columnstore is best for analytical workloads across large historical datasets.

Rowstores are the default table type, but columnstores can be created by specifying a columnstore index type. A combination of the SingleStore rowstore and columnstore engines simplifies your technology stack by allowing you to merge real-time and historical data in a single query.

In addition to handling mixed workloads, SingleStore supports high concurrency for simultaneous users. A distributed query optimizer evenly divides the processing workload to maximize the efficiency of CPU usage. Query plans are compiled to machine code and cached to expedite subsequent executions. A key feature of these compiled query plans is they do not pre-specify values for the parameters. This allows SingleStore to substitute the values upon request, which enables subsequent queries of the same structure to run quickly.

Multi-Version Concurrency Control (MVCC)

SingleStore uses Multi-Version Concurrency Control (MVCC) to support high concurrency, which allows simultaneous reads and writes without blocking. For example, when an UPDATE query is run, SingleStore creates a new version of the rows to be updated, while the old version remains accessible to transactions that began before the UPDATE. This ensures concurrent reads for SELECT queries without waiting for write operations to finish. SingleStore maintains multiple versions of the data until all the read and write transactions (both SELECT and UPDATE) that need access to the old version have completed. However, this consumes additional disk space. Once these transactions have completed, the older versions are removed through garbage collection and the disk space is freed. This approach optimizes storage usage without compromising performance. By combining MVCC with lock-free data structures, SingleStore achieves high throughput, low latency, and efficient handling of both OLTP and OLAP workloads.

For more information, refer to:

Last modified: November 27, 2024

Was this article helpful?