mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-09-07 17:15:56 +00:00
Add new architecture docs page with roaring storage section
This commit is contained in:
parent
d3eef0d3eb
commit
970795bac1
1 changed files with 21 additions and 0 deletions
21
docs/architecture.md
Normal file
21
docs/architecture.md
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
+++
|
||||
title = "Architecture"
|
||||
+++
|
||||
|
||||
## Architecture
|
||||
|
||||
### Roaring bitmap storage format
|
||||
|
||||
Bitmaps are persisted to disk using a file format very similar to the [Roaring Bitmap format spec](https://github.com/RoaringBitmap/RoaringFormatSpec). Pilosa's format uses 64-bit IDs, so it is not binary-compatible with the spec. Some parts of the format are simpler, and an additional section is included. Specific differences include:
|
||||
|
||||
* The cookie is always bytes 0-3; the container count is always bytes 4-7, never bytes 2-3.
|
||||
* The cookie includes file format version in bytes 2-3 (currently equal to zero).
|
||||
* The offset header section is always included.
|
||||
* RLE runs are serialized as [start, last], not [start, length].
|
||||
* After the container storage section is an operation log, of unspecified length.
|
||||
|
||||

|
||||
|
||||
All values are little-endian. The first two bytes of the cookie is 12346 when the file contains no RLE containers, or 12347 when it does. In the no-RLE case, the runFlagBitset is absent. Otherwise the format is identical in both cases. Container types are determined by their cardinality - a container with 4096 or more values is a bitmap, a container with fewer is an array or RLE container. A high bit in runFlagBitset indicates an RLE container.
|
||||
|
||||
Storing the runFlagBitset in a separate section, indicated by the cookie value, keeps this format backward compatible with older storage versions that do not support RLE containers.
|
||||
Loading…
Add table
Reference in a new issue