Database Reference
In-Depth Information
plication,astheymayhavefundamentallydifferentusagepatterns.Unfortunately,thisisn't
possible with embedded mode. You'd need to find settings that could function reasonably
well for both database and application needs combined. Having said that, as stated earli-
er,manycompanieshavesuccessfullyembeddedNeo4jintheirapplications,butobviously
special consideration needs to be given to this area if you do. Chapter 11 goes into more
detail about how to tune and maintain the JVM for optimal Neo4j use.
Additionally,becauseNeo4jisaJava-basedapplication,itwillhavedependenciesonother
common libraries. Neo4j uses Lucene as its core indexing implementation (see listing
10.2 ) . Although care has been taken to minimize these dependencies, if your application
also makes use of any of these shared common libraries, you'll need to ensure that only
oneappropriate version is included andused inthe JVMat anygiven time; otherwise there
may be unexpected results, either in your application or in the way the database behaves.
This is generally not a big issue, but it's something to be aware of.
Hardware considerations
Closely linked to the preceding separation of concerns issue are hardware considerations.
For Neo4j to operate and function as efficiently as possible, it ideally needs a beefy ma-
chine with a lot of RAM and sufficiently fast disks (refer to chapter 11 for more details).
If your setup is such that this isn't possible—for example, if you have an existing limited
application server box or a set of boxes that can't be upgraded for whatever reason—then
embedding Neo4j in your application may well bring your hardware to its knees.
In this case, one option may be to procure a new machine with sufficient memory where a
Neo4j server instance could reside, leaving the application server boxes to deal with what
would be considered a more typical application memory profile. If you can upgrade your
machine to accommodate the additional Neo4j needs, the embedded approach could be a
viable option.
10.4.2. Performance considerations
Performance isoneofthe keyareas where the embedded andserver modes differ.Neo4j in
embedded mode will always outperform the server mode when doing a direct comparison
of execution times for the same set of operations done via the native Java API as opposed
to the REST API. This is due to the added latency and overhead associated with making
calls over the network.
Search WWH ::




Custom Search