Skip to content

[MULTI-DB] Create database abstraction layer #1006

@OVI3D0

Description

@OVI3D0

We should create an abstraction layer in OSB. Rather than just having separate files for each DB, OSB should be able to support multiple DB's through a unified interface.

This will enable OSB to benchmark any DB that supports similar operations (bulk indexing, search, etc) while reusing existing workloads if possible, maintaining the same user experience and metrics collection, and keeping the codebase maintainable.

There should be abstract base classes (contracts) that each DB should follow, with clients, a set of operations/API calls, and runners.

OpenSearch organizes operations into namespaces (e.g., client.indices.create()) so we can preserve that same pattern:

class IndicesNamespace(ABC):
    """Operations on indices/collections."""

    @abstractmethod
    async def create(self, index, body=None, params=None):
        pass

    @abstractmethod
    async def delete(self, index, params=None):
        pass

    @abstractmethod
    async def exists(self, index, params=None):
        pass


class ClusterNamespace(ABC):
    """Cluster-level operations."""

    @abstractmethod
    async def health(self, index=None, params=None):
        pass

and provide factories for creating DB clients without knowing which implementation to use.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Status

👀 In Review

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions