Database Reference
In-Depth Information
• Using the Cypher endpoint
• Using the REST transactional endpoint
• Using server plugins or unmanaged extensions
• Using batch operations
Depending on your situation, you may be able to define a single Cypher statement that's
able to perform multiple operations in one go. Section 10.5.2 provides more details on
using the Cypher endpoint. Additionally, there's also a Transactional REST endpoint
( http://docs.neo4j.org/chunked/stable/rest-api-transactional.html ) , which allows you to ex-
ecute a series of Cypher statements within the scope of a transaction, over multiple HTTP
requests. With this option, the client explicitly issues commit or rollback commands via
dedicated REST endpoints.
Server plugins and unmanaged extensions enable you to write server-side code that can
take the data for creating the nodes in a single HTTP request, and then on the server side
ensurethey'recreatedasasingletransaction (see sections 10.5.3 and 10.5.4 forexamples).
Neo4j also provides functionality called batch operations that allow you to send groups or
batches of low-level REST instructions over a single HTTP call, where all of the batched
instructionsgettreatedasasingleunitwhenexecutedontheserverside.Moreinformation
about batch operations can be found in the “Transactional HTTP endpoint” section of the
Neo4j Manual, at http://neo4j.com/docs/stable/rest-api-transactional.html .
10.5. Getting the most out of the server mode
This final section highlights options for extracting the best possible performance out of the
server mode, under a given a set of circumstances. As we've said before, the server mode
will suffer more than the embedded mode in the area of performance, but by using some of
thesetechniquesandapproaches,servermodeperformancecanbebroughttoanacceptable
level.
To fully understand and appreciate the differences between the approaches we'll present,
the remainder of this section will use our social network domain as an example to see how
these different approaches result in different performance metrics. Let's assume you have
a requirement to be able to find and return the names of all of a user's immediate friends,
specifically friends whose names start with the letter J . In your system, there's already a
user set up, Adam, who has 600 immediate friends, 15 of whom have names starting with
 
Search WWH ::




Custom Search