Storage Engine Overview

The storage engine serves as the foundational storage layer of a database system. Based on the storage engine, databases perform operations such as data creation, querying, updating, and deletion. Depending on your requirements, different storage engines provide distinct storage mechanisms and can be combined with various execution engines to form specialized database microkernels for specific scenarios.

Currently, the YMatrix database system supports the following storage engines:

  • HEAP, based on PostgreSQL
  • AO (Append-optimized), based on Greenplum
  • MARS2, independently developed by YMatrix
  • MARS3, optimized from MARS2
Storage Engine Description
HEAP The storage engine provided by PostgreSQL, also known as heap tables, uses row-oriented storage. This type of table supports high-concurrency read/write operations, transactions, indexes, and other features.
AO The storage engine provided by Greenplum, also known as Append-Optimized (AO) tables, uses an append-optimized format for bulk loading and reading data, offering performance advantages over HEAP tables. Append-optimized storage provides checksums for data protection, compression, and support for both row- and column-oriented formats. Both row- and column-oriented AO tables support compression.
MARS2 A storage engine developed on top of MARS. By leveraging physically ordered merging, it reduces I/O seek operations and improves query performance. MARS2 supports compression, columnar storage, automatic archiving, pre-aggregation, and other features, delivering excellent performance in time-series scenarios. For compression, MARS2 offers a customizable solution: Encoding Chain (mxcustom). Enabling the encoding chain allows fine-grained, targeted, and deep compression. MARS2 tables do not support data updates or deletions.
MARS3 A storage engine built upon MARS2. It inherits MARS2's performance advantages in time-series workloads and extends support to both AP and TP scenarios. In addition to inheriting key features from MARS2—such as Encoding Chain compression and columnar storage—MARS3 optimizes write performance to handle diverse write patterns (e.g., high-frequency small-batch TP workloads and low-frequency large-batch AP workloads). MARS3 supports standard data update and delete operations, MVCC, adding/dropping columns, and BRIN indexes.

The following table compares core features of MARS2 and MARS3:

Feature MARS2 MARS3
Storage Format Columnar Hybrid row-column or columnar
Compression Supports Encoding Chain Supports Encoding Chain
Data update and deletion via UPDATE and DELETE clauses Not supported Supported
Add/drop columns Not supported Supported
MVCC Not supported Supported
Runtimefilter Supported Not supported
Storage Diagnostics Supported Not supported
Batch Data Merge (UPSERT) Supported Supported
INSERT INTO ... VALUES ... ON CONFLICT ... DO UPDATE syntax Not supported Not supported
Indexes Must create one mars2_btree index specifying the sort key at table creation; otherwise, the table is invalid (functionally equivalent to the ORDER BY clause in MARS3 tables) Can optionally create one or more mars3_brin indexes to improve query efficiency (functionally similar to minmax indexes in MARS2 tables)
Table Parameter Configuration WITH(a=1,b=2,...) WITH(mars3options='a=1,b=2,...')