Skip to content

Integrate Automatic Indexing into DB #1

Closed as not planned
Closed as not planned
@CMCDragonkai

Description

@CMCDragonkai

Specification

Indexing is the act of creating a separate data structure that makes it faster to lookup data on a primary data structure.

PK has several domains that require secondary indexing:

  • acl - perm id, vault id, node id
  • gestalts - discovery, adjacency list indexing
  • nodes - possibly needed in the future for all sorts of optimal routing needs (kadmelia indexing?)
  • notifications - to be able to filter notifications
  • sigchain - to be able to filter sigchain
  • vaults - for vault tagging and vault names

Right now secondary indexing is implemented manually in ACL by persisting bidirectional maps in leveldb.

Indexing is tricky topic, and it's better to create a single indexing mechanism in DB so that all domains in PK can benefit from them.

Generic indexing can reply on LevelDB's eventemitter interface. The good thing is that other people have already created good libraries for this:

The second library automates some of level-auto-index. In fact it binds secondary index interfaces to the leveldb object.

For @matrixai/db it makes more sense to use level-auto-index so we can more tightly control how the indexes are stored. Most likely via sublevel interfaces.

Additional context

Tasks

  1. - Investigate possible dependencies to automate secondary indexing and their relationship
  2. - Prototype the usage of level-auto-index
  3. [ ] - Integrate the level-auto-index into this library's domain/level creation, each level including the root level should have the ability of attaching a secondary index (or multiple secondary indexes)

Metadata

Metadata

Labels

designRequires design (architecture, protocol, specification and task list requires further work)developmentStandard developmentenhancementNew feature or requestepicBig issue with multiple subissuesr&d:polykey:core activity 1Secret Vault Sharing and Secret History Managementr&d:polykey:core activity 3Peer to Peer Federated HierarchyresearchRequires research

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions