The goals of shelf are:
- To enable utilization a single collection of items for all assets, authors, comments, actions, etc., such that management of the items is straightforward and such that we don't need to worry about complex indexing of the items for joins.
- To generate on-the-fly or cached sub-collections of items (or "views") for analysis, aggregation, display, etc.
- To manage all relationships between items ("authored by," "blocked," etc.).
This POC mocks out much of this functionality, such that we can evaluate architecture decisions, formatting, config, etc. The POC includes the following:
- Data importing/ingestion using a branch of
xenia
(item-cayley) with a modified internalitem
package andsponged
cmd. - Dummy data and relationship generation using the
shelfdummy-direct
program included here or theshelfdummy-sponged
included here. - View generation based on relationships using the
shelfquery
web server included here. - Stats collection for views using the
shelfstats
script includes here.
Disclaimer - The code in this repo is meant for evaluation only and should not be utilized in any production systems. After evaluating functionality with this POC, actual shelf functionality will be implemented as part of the xenia repo.
sponged
- as built from theitem-cayley
branch ofxenia
- MongoDB - note, you may want a separate instance of mongo running for this POC as it will create databases, indices, etc. Just so it doesn't break anything you are currently using that is dependent on Mongo.
If you want to create dummy data for testing using directly, where items do not have embedded relationships and relationships are only reflected in the graph DB:
- Build the
shelfdummy-direct
binary by executinggo build
here, OR build a Docker image including the binary using the Makefile. Note, you would likely want to change the tags of the docker image to build locally or push up to the docker registry of your choice. - Define the example environmental variables in shelf.env. Modify them according to how many documents you want to generate.
- Run
shelfdummy-direct
(or the Docker image if you built it). When this executes, it will: - Generate dummy items including assets, comments, and users in the proportions 5%, 80%, and 15%, respectively. - For each of the generated items, store the item along with inserting the item and any relevant relationships into the Cayley graph DB.
If you want to create dummy data for testing using sponged
, where sponged
will both embed relationships in Mongo and create graph DB items:
- Build the
shelfdummy-sponged
binary by executinggo build
here, OR build a Docker image including the binary using the Makefile. Note, you would likely want to change the tags of the docker image to build locally or push up to the docker registry of your choice. - Define the example environmental variables in dummy.env. Modify them according to where
sponged
is installed and how many documents you want to generate. - Run
shelfdummy-sponged
(or the Docker image if you built it). When this executes, it will: - Generate dummy items including assets, comments, and users in the proportions 5%, 80%, and 15%, respectively. - For each of the generated items, send the item tosponged
, wheresponged
will format, verify, and store the item along with inserting the item and any relevant relationships into the Cayley graph DB.
If you want to utilize real world data for testing:
- Make sure
sponged
(based on theitem-cayley
branch of xenia) is running. - Create a script that push assets, comments, and authors to the
sponged
endpoint defined here. - Run your script to import the data.
- Build the
shelfquery
binary by executinggo build
here, OR build a Docker image including the binary using the Makefile. Again, you would likely want to change the tags of the docker image to build locally or push up to the docker registry of your choice. - Run
shelfquery
.
You will now be able to make use of the view endpoints described here.
- Build the
shelfstats
binary by executinggo build
here. - Set these environmental vars.
- Run
shelfstats
. This will output stats (see example here) for all available queries to standard out.
What's next? Find out more in our product document (work in progress.)