Skip to content

Proof of concept of federated works and recordings queries for the OMI API

License

Notifications You must be signed in to change notification settings

omi/simple-federated-queries

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

simple-federated-queries
========================

Simple proof of concept code for doing federated queries for OMI.


Getting Started
---------------

Create a file called `settings_local.py` and add OMI api's to it, eg::

    OMI_ENDPOINTS = {
        "sawtooth": "http://localhost:8000/",
        "musicbrainz": "http://localhost:8888/api/",
    }


Setup
~~~~~

 $ ./setup_venv.sh

Run
~~~

 $ source venv3/bin/activate
 $ python app.py


Known Issues
------------

Sorting and Paging
~~~~~~~~~~~~~~~~~~

Without sorting in the OMI API Spec there is no easy way to have stable query results.
At this point we do not try to solve this. Specifying `offset` to queries will not have
a stable result.

Memory Usage
~~~~~~~~~~~~

Even though the federated api uses coroutines extensively reading of the JSON from other
API's is not done in a streaming matter and it will load the entire JSON into memory before
streaming it back to the client.

Source Indicator Duplication
~~~~~~~~~~~~~~~~~~~~~~~~~~~~

In the results like a `_source` object is added to indicate which API the result came from.
Since this object is added to each result item and it's always the same it adds a lot of
overhead to the response. This could be improved by adding one `sources` object at the root
of the response and then adding only a small reference in each result item.

Example::

    {"sources": [ { "name": "..", "url": "..." } ], ...}

    and

    {"results": [ {"_source": "...", ...}], ...}

About

Proof of concept of federated works and recordings queries for the OMI API

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published