Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Should we use the Neo4J internal id?

Tags:

neo4j

We are currently working with a Neo4j database, and we need some kind of id to identify nodes.

For example we have functions like CurrentUserHasAccess(NodeId)

On other Stackoverflow posts I read that it's a bad idea to use the internal neo4j-identifier, because it can change over time. However I think that's not an issue when we do not use this id to link data.

However I cannot seem to find any official sources about this topic.

I would like to use this ID because then we do not need to worry about uniqueness, and more importantly indexing.

like image 944
mhtsbt Avatar asked Feb 10 '23 21:02

mhtsbt


1 Answers

You are right that it is generally not recommended to use the internal Neo4j node IDs. This is mainly because if a node gets deleted, its original internal ID may get recycled/reused. If you're looking for a quick and elegant solution to this, have a look at the UUID module of the GraphAware Framework here https://github.com/graphaware/neo4j-uuid and let us know if it works for you.

like image 159
Daniela Merglova Avatar answered Feb 19 '23 03:02

Daniela Merglova