I wanted to know if there is any Neo4j equivalent of a stored procedure?
When I researched this, I came across events
, but I found them more like triggers and not stored procedures.
相关问题
- Can I parameterize labels and properties on CREATE
- run neo4j with docker-compose - neo4j not accessib
- How to create multiple nodes with cypher in neo4j
- Order by relationship properties neo4j
- How can I specify which relationship type to use a
相关文章
- How does Cassandra scale horizontally ?
- Modelling a Chat like Application in Firebase
- Neo4j DATE Data Types
- NoSQL Injection? (PHP->phpcassa->Cassandra)
- How can I get the number of nodes of a Neo4j graph
- What is the fully qualified path of the Neo4j data
- Connect Parse with external database?
- Neo4j in Azure mobile services
Stored procedures are available as capabilities CALLABLE from the Cypher language since version 3.0
EDIT
As Neo4J 3.0 has been released in April'16, the stored procedure became an official, Apache 2.0 licensed, repository.
http://neo4j-contrib.github.io/neo4j-apoc-procedures/
Available procedures range from data manipulation/import to Spatial and complex graph algorithms (es. Page Rank, Dijkstra, Community detection, betweenness centrality , closeness centrality, etc)
My answer here does not answer the question directly (Stefan's answer does just fine for that). With that said, if any of you are considering writing server plugins (to get Stored Proc behavior) before your project is actually being used in production (which at the time of this writing is the vast majority of the Neo4j userbase), I strongly recommend not doing so.
Server plugins add architectural complexity to your project. You will require JVM developers to maintain them. Deploying or updating them can be tricky, and the associated source control methodologies are not intuitive. Neo4j doesn't require schema migrations, which makes your job as a developer easier. Adding server plugins will no longer give you that benefit, and since it's not a mainstream use case of Neo4j, you'll be getting little help from the developer community, and improvements and bug fixes related around that function will be given lesser priority from the Neo4j team.
And all that would be for possibly a slight performance boost, or none at all.
"Stored Procedures" (or using server plugins as such) are an important feature to have in the context of performance tuning, but if your team is still two guys in a garage, don't even think about going down this path.
There are basically two techniques to extend a Neo4j server:
Both techniques require to write code in JVM (or other JVM language), package a jar file and deploy it to Neo4j server.