Skip to content

Rework DB layer for better performance and enable indexes #341

@Frostman

Description

@Frostman
  • bolt schema improvements
    • bucket per type
    • simplified keys w/o namepaces and kind in it, for policy objects key will return ns/name
    • use binary.LittleEndian.PutUint64 for version encoding
    • replace current key with "reference" that include kind, namespace and name
    • deleted flag should be handled outside of DB layer, it's just a Versioned object with deleted field
    • do setting of new generation inside same transaction
  • add indexes support
    • implement indexes primarily w/o using reflection
    • support list / first / last indexes
    • automatic index for versioned object to query last version
    • get should use index for getting last version of the versioned object
  • cover all parts of new DB layer with at least basic unit and integration tests
  • encoding improvement
    • separated codec w/o kind manipulation for higher performance
    • use god or message pack by default
    • codec benchmark to find best codec for DB

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions