Skip to content

[Initiative] API Datastore Abstraction with Config-Selected Runtime Backend #100

@juliuskrah

Description

@juliuskrah

Summary

Introduce a datastore abstraction in gitstore-api so runtime storage can be selected by configuration, with an initial implementation targeting two backends.

Inspired by SpiceDB datastore patterns: https://github.com/authzed/spicedb/tree/main/internal/datastore

Scope

In Scope

  • Define a datastore interface/contract for API persistence paths.
  • Add runtime datastore selection via configuration (e.g. env/config key).
  • Support exactly two initial datastore implementations.
  • Provide boot-time validation and clear errors for unsupported datastore values.
  • Document datastore architecture and configuration options in docs/.

Out of Scope

  • Additional datastore backends beyond the first two.
  • Advanced multi-datastore routing or hybrid read/write splitting.
  • Data migration tooling beyond backend-specific migration support included in subtasks.

Acceptance Criteria

  • gitstore-api uses a datastore abstraction instead of direct backend coupling in core persistence paths.
  • Runtime config selects the datastore implementation without code changes.
  • Unsupported datastore config values fail fast with actionable startup errors.
  • Integration tests cover datastore selection and basic CRUD parity across supported backends.
  • Documentation explains datastore config and extension points for future backends.

Subtasks

Tracking

  • Milestone: TBD
  • Labels: initiative, enhancement, area/infra, priority/p1

Metadata

Metadata

Assignees

No one assigned
    No fields configured for Feature.

    Projects

    Status
    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions