Skip to content

Internal LevelDB Setup

Calvin Metcalf edited this page Apr 17, 2014 · 1 revision

While this is just for the LevelDB adapter, the IndexedDB and WebSQL ones are setup similarly.

We use LevelUp as a driver for LevelDB and partition the database using SubLevel into 4 sub databases.

  • docStore stores document metadata by doc id
  • bySeqStore stores document content by sequence number, and since sequence numbers will always be binary, database metadata is stored here with string keys.
  • attachmentStore stores some sort of index for attachments
  • binaryStore stores actual attachments

to get a document you first get the document sequence number by querying the docStore and then query the bySeqStore to get the document data.