liveBook · Manning

Datastore interface

As explained in Effective Platform Engineering

A datastore interface is a defined set of database access operations that different datastore implementations must provide.

A datastore interface defines the database-access operations that supported datastore implementations must provide. It lets repository and service code remain unchanged when the underlying database technology changes. section 2.3.3

A platform can use the interface to:

  • Place a repository layer above datastore implementations and expose consistent database methods to services. section 2.3.3
  • Select the correct database interface for relational or unstructured storage and the chosen cloud technology. section 2.3.3
  • Support migration between cloud providers or database products by rebuilding with a new datastore library rather than rewriting service code. section 2.3.3

Layered service access

A service calls a repository function for normal database operations. The repository delegates to datastore functions for the selected relational or unstructured database, keeping database-specific choices below the service layer. section 2.3.3

Figure 2.12 When a particular service within the API needs to interact with the API database, it calls a repository function that provides all the normal database methods. The repository function would call the datastore functions for the type of database the API needs to use (relational or unstructured, in our case).
A close-up of a text

AI-generated content may be incorrect.

Trace the service, repository, and datastore layers used to route API database operations. section 2.3.3

How Effective Platform Engineering covers it

How deep it goes
Explains repository delegation, implementation selection, migration, and architectural tests without specifying complete interface signatures.
Examples
Uses relational and unstructured databases, cloud migration, repository calls, and layered-architecture fitness-function pseudocode.
What it assumes
Assumes familiarity with services and databases while defining the abstraction and its repository-based placement.
What you can do after
Apply it to isolate database choices behind repository and datastore layers, then test ongoing architectural adherence.
How it connects
Connects datastore interfaces to repository patterns, database abstraction, cloud migration, and architecture fitness functions.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Effective Platform Engineering. The section links point to the parts of the book it draws on.