-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME
61 lines (39 loc) · 1.45 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
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": "...", ...}], ...}