Skip to content

[datastore] Improve store/datastore implementation #1418

@the-glu

Description

@the-glu

The current datastore/store implementation is quite complex with some 'loops' and database specific elements in generic classes.

Here is the current schema of interfaces/packages:

Image

Other packages work with instances of the only type in the schema.

I propose change it it like this:

Image
  • The common store.Store takes care of initialization in a generic way, without knowing about specific databases.
  • No intermediate stores in specific packages.
  • Specific database implementations moved to dedicated structs (with explicit naming), including initialization, and are embedded as needed in the package's repository implementations. Common struct used for function needed during initialization by store.Store.
  • Should a new type of storage be used, only the implementation of the generic store + the implementation of the repository would be added + a way to initialize the correct "sub-store." This is shown with low opacity on the schema.
  • Other packages still use the only type in the schema.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions