Database Reference
In-Depth Information
key. (This can usually be found in the conf directory of the Neo4j server installation.) The
mappingconsistsofdefiningtheJavapackagethatcontainstheextensionclasses.Youmap
this to the base mount point as shown in the following snippet:
org.neo4j.server.thirdparty_jaxrs_classes=com.manning.neo4jia.chapter10.un
managedext=/n4jia/unmanaged
This means that to execute the unmanaged extension and get all of Adam's friends' names
starting with the letter J , you'd need to issue an HTTP GET against http://localhost:7474/
n4jia/unmanaged/example/user/adam001/jfriends.
Table 10.8 shows how the unmanaged extension in listing 10.15 fares against the other ap-
proaches you've seen so far.
Table 10.8. Performance metrics log after scenario 4, unmanaged extension
Curl client
Java REST binding
Number of
server calls
made
Scenario
Description
Cold
Warm
Cold
Warm
1
Raw REST API 602
5726 ms
5303 ms
1066 ms
917 ms
2
Cypher call
1
740 ms
45 ms
104 ms
32 ms
3
Server plugin 1
147 ms
20 ms
76 ms
16 ms
Unmanaged ex-
tension
4
1
158 ms
20 ms
119 ms
18 ms
Besidesprovidingyetanothermechanism forimprovingtheperformanceoftheserver,un-
managed extensions provide benefits in allowing you to define a domain-specific REST
API, as well as the ability to use whatever data interchange format—JSON, binary, text, or
otherwise—you choose. We reiterate our warning, however, that this powerful tool needs
to be managed carefully lest you inadvertently open Pandora's box.
10.5.5. Streaming REST API
As of Neo4j version 1.8, the option to “stream” the JSON responses to REST requests has
been introduced as another means for improving the performance of the Neo4j REST API.
By default streaming is turned off.
 
Search WWH ::




Custom Search