Skip to content

Increase core code? #812

Open
Open
@rhysrevans3

Description

@rhysrevans3

This might be more of a discussion point that an issue. But it seems to me there is a lot of duplication between the different backends. Would it be possible to harmonise them. I know @jonhealy1 done something similar with the Elasticsearch and Opensearch parts of STAC FastAPI Elasticsearch Opensearch but I wondered if this was extendable to the other backends.

Possible areas of shared code:

  • Base Database model. Having a common set of methods, with typed input and outputs, for the database would make code sharing of other areas easier.
  • Switching from abstract methods to default methods for the BaseCoreClients. This would mean moving backend specific code to the database level which would give better separation of the API and Database layers. These methods could still be overridden in the backend if needed.
  • Base app.py. Most of this code looks like it could be shared if extensions can be split into API and Database components.
  • Authentication. Authentication should be independent of the chosen database.
  • Utilities. Some utility methods are copied across multiple backends and I imagine there are others that could be shared.

Ideally the only parts exclusive to the backends should be the database, serialisation, settings, and the database components of extensions. I understand this level of code sharing may not be possible.

This would require substantial changes to the core and backend code bases so I wanted to see if others agreed or if the backends were too different.

Tagging some people I think might have opinions please share with others.

@vincentsarago @jonhealy1 @m-mohr

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