-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Welcome to the data-repo wiki!
The main idea behind the data-repo package is to build a very simple interface using REST-based operations instead of CRUD operations to interact with common data stores. We believe this interface has a few key benefits over standard data persistence / ORM frameworks (e.g. Mongoose):
- It is completely decoupled from any underlying database technology or platform (or really, databases at all)
- It can be implemented (easily) using a RESTful API client instead of a database client, easing migration from monolith to micro-service architectures
- It uses idempotent PUT instead of CREATE / UPDATE, making it easier to build resilient distributed applications that tolerate retries
In building early prototypes for the package, we found it useful to explicitly register indexes with the data repository. (This is essential for our goal of compatibility with DynamoDB.) We believe this is also a unique characteristic of this library, and unlocks additional benefits around managing indexes, even for more flexible database systems including MongoDB and SQL databases. By having knowledge of which indexes are implemented in the database layer, this library can prevent queries that are not well covered by indexes. We are adding additional configuration options in our IndexDefinition
objects to allow more fine grained control for schema designers, including indicating which, if any, fields are required for all lookups in a way that can allow sub-optimal database queries to be identified and prevented early in the development cycle.
For our initial public launch of this package, we intend to have the following implementations of this interface:
- @data-repo/dynamo
- @data-repo/mongo
- @data-repo/redis
- @data-repo/generic-rest