BOLTDB Source Analysis-Data structure-1

Source: Internet
Author: User
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;

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.