Leszek
Leszek

Reputation: 1360

fast neo4j query with python and java API

I want to use neo4j for large graph querying (12M nodes, 1.5G relations). I have tested the performance, and using cypher it's unsatisfactory as for the web-server.
Since java API query is >10x faster than the cypher, I want to write necessary query functions in java and handle everything in Python (my website backend is written in Python).

Can you give me some hints how to approach the problem of running Java functions within Python?

I have managed to run JPype. But only one java instance can access the embedded database. For that, py4j using background JVM process may be better solution. Yet, I cannot make py4j working. Do you have an experience with py4j? Or Python and neo4j java API?

Upvotes: 0

Views: 234

Answers (1)

Stefan Armbruster
Stefan Armbruster

Reputation: 39925

The best way to achieve this is writing unmanaged extensions to your Neo4j server in Java. These unmanaged extensions expose new REST endpoints which can then be called from python via http. A while ago I've created a kind of template for unmanaged extensions using gradle as build system.

Upvotes: 2

Related Questions