Caution: the Architecture Guide is not updated in lockstep with the code base and is not necessarily correct or complete for any specific release.
Layered tables are an access method designed to support distributed systems that leverage shared storage for the majority of a table's data. Generally speaking, a layered table is not a table in the traditional sense, but rather an adapter that splits data access between two layers.
This mechanism enables a single leader node to perform writes to the stable table, while other follower nodes maintain a consistent view by tracking recent changes. Having followers track recent changes allows for two key features:
Tables can be distinguished by the backing storage mechanism. A shared table is a table whose data is stored in a shared storage back-end. Whereas a local or regular table is a table whose data is locally, either in-memory or on disk. In a layered table, the stable table is shared, and the ingest table is local.
There are also shared tables that are not part of any layered table (e.g., a shared history store table or a shared metadata table). The key difference between a regular table and a shared table is that the shared one uses the disaggregated block manager.
The following diagram is not meant to strictly represent entities relationships, but rather to aid in understanding the high-level design.
These semantics are achieved by using two underlying constituents: a shared stable table and an ingest table. The node responsible for writing to shared storage operates directly on a single shared table and has the guarantee that no other node will perform writes to that table. All other nodes will also have an ingest table, which holds a short-term view of recent changes.
The ingest table's view is layered over the shared stable table, so any read operations on a node with both an ingest and stable table will first look for a result in the ingest table, and if no result is found, fall back on the shared table.
Layered tables are primarily for Disaggregated Storage Clusters (DSC) but can also be used outside of DSC for testing purposes, in particular, via local Page and Log Mock (PALM) infrastructure.
Stable Table:
Ingest Table:
Layered tables support all the regular tables operations, with exceptions listed here:
Note: This section is closely tied to the source code and may become outdated if not maintained in sync with implementation changes.
Each layered table contains three related entries in metadata:
The ingest and stable table could also have table: prefixed metadata entries if the table was created with the block_manager=disagg,type=layered config.
Since shared metadata and history store tables are shared but not layered tables, they both have .wt_stable suffixed metadata entries but no associated layered: ones: