You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor: split JSTable into summary and data files
Separated JSTable storage into .summary (header + filter) and .data (records) files. Updated JSTable write, read, and iteration logic. Updated DB to handle new file extensions during load, flush, and compaction. Updated specs.
Copy file name to clipboardExpand all lines: specs/storage.md
+9-3Lines changed: 9 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,18 +3,24 @@ A JSTable is like an SSTable, but stores semi-structured JSON data with an assoc
3
3
4
4
# Disk format
5
5
6
-
Each JSTable is stored in a single binary file using the [JSONB](https://github.com/databendlabs/jsonb) format.
7
-
The file consists of a sequence of entries. Each entry is encoded as:
6
+
Each JSTable is stored as two binary files using the [JSONB](https://github.com/databendlabs/jsonb) format: a summary file (`.summary`) and a data file (`.data`).
7
+
8
+
The files consist of a sequence of entries. Each entry is encoded as:
8
9
1.**Length**: A 4-byte unsigned integer (little-endian) indicating the size of the following JSONB blob.
9
10
2.**Data**: A binary blob encoded using the JSONB format.
10
11
11
12
## Structure
12
13
14
+
### Summary File
15
+
13
16
1.**Header Entry**: The first entry in the file. It is a JSONB-encoded object containing:
14
17
*`timestamp`: The time the table was created (Unix timestamp in milliseconds).
15
18
*`schema`: The JSON Schema for the documents.
16
19
2.**Filter Entry**: The second entry in the file. It is a [Binary Fuse8](https://github.com/ayazhafiz/xorf) filter of the record IDs in the table, serialized as a JSON byte vector.
17
-
3.**Record Entries**: All subsequent entries. Each is a JSONB-encoded array `[id, document]`:
20
+
21
+
### Data File
22
+
23
+
1.**Record Entries**: All entries. Each is a JSONB-encoded array `[id, document]`:
18
24
*`id`: String.
19
25
*`document`: The document object (or `null` for tombstone).
0 commit comments