You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Right now Amphora floats in a nebulous area in regards to which database to use. The approach has been to allow any key/value store via a levelup, but this approach creates more work for an implementation to write code around its db implementation and makes it harder for the platform to implement new features because every implementation could drastically diverge.
Goal
One primary goal exists: to define a consistent API for how Amphora communicates with a DB. This would have the following benefits:
Any db solution could be developed as long as it abides by this API
Opinionated caching strategies can be developed to increase performance
API (This will be updated as development progresses)
Registration
Register the DB connector with Amphora at instantiation time with the storage property
The value of storage should be an object who exports the following functions:
Default Function: connects to the database you specify, will be called by Amphora at startup time
get: receives the uri of a Clay data structure and expects Promise which resolves a JSON object in return
put: receives two arguments (key and value) and expects a Promise in return
del: receives the uri of a Clay data structure and expects a Promise in return
batch: receives an array of objects with key and value properties, expects a Promise in return
createReadStream: receives a set of options and expects a read stream in return who will output id strings of objects from Clay (TKTKTKTK Make this better)
Deliverables
A refactored Amphora API to use a storage module
A storage module using Postgres for storage and Redis for caching (more details will be outlined in said package)
The text was updated successfully, but these errors were encountered:
Problem
Right now Amphora floats in a nebulous area in regards to which database to use. The approach has been to allow any key/value store via a levelup, but this approach creates more work for an implementation to write code around its db implementation and makes it harder for the platform to implement new features because every implementation could drastically diverge.
Goal
One primary goal exists: to define a consistent API for how Amphora communicates with a DB. This would have the following benefits:
API (This will be updated as development progresses)
Registration
Register the DB connector with Amphora at instantiation time with the
storage
propertyStorage API
The value of
storage
should be an object who exports the following functions:get
: receives the uri of a Clay data structure and expects Promise which resolves a JSON object in returnput
: receives two arguments (key
andvalue
) and expects a Promise in returndel
: receives the uri of a Clay data structure and expects a Promise in returnbatch
: receives an array of objects withkey
andvalue
properties, expects a Promise in returncreateReadStream
: receives a set of options and expects a read stream in return who will output id strings of objects from Clay (TKTKTKTK Make this better)Deliverables
The text was updated successfully, but these errors were encountered: