This is a creation in
Article, where the information may have evolved or changed.
BOLTDB Data structure
boltdbThe data exposed to the user is less conceptual, with only the following:
Optionsboltdbthe relevant configuration selection at initialization;
DBThe entire boltdb holder, and boltdb related operations are to be initiated by invoking its method, which is boltdb an abstraction;
StatsDB.Stats()the data structure returned by the calling method contains some boltdb internal count information that can be viewed by the user;
BucketSimilar to 表 a concept, in the BOLTDB related data must exist Bucket under a different Bucket data isolation, each under a Bucket monotonically increasing Sequence , similar to the self-incrementing primary key;
BucketStatsBucketSome of the statistical information;
TxboltdbTransaction data structure, in boltdb which all the operations on the data must occur within a transaction, and boltdb the concurrent reads are implemented here;
Cursoris an iterator to the internal b-tree, which is used to traverse the database, provide First / Last / Seek and other operations;
There are also internal data structures that help implement some internal logic:
node is used to store each bucket Part of Key-value, each bucket inode records the data structure of the key-value pair, each node contains a inode array, inode is a k-v memory-cached record that is recorded as leafpageelement ;
leafpageelement disk to record the specific Key-value index;
page user records important information for each region in the persisted file, while page is divided into a variety of Code class= "Highlighter-rouge" >page stores different data information;