Reputation: 37369
I've used OrientDB quite a bit, and in OrientDB, a record (or node or relationship) is assigned an ID that persists for it's lifetime. The ID may (and will) be re-used if the record is deleted, but as long as the same record exists, it has the same ID (even after a restart). My question is: does Neo4j do this as well? My application has greatly reduced the number of times it uses node IDs directly by querying instead. But there are still some times that I'd like to use the IDs. Is this possible in Neo4j?
And just FYI, I haven't actually done any work with Neo4j yet. I've just been reading the manual preparing for our eventual switch. So if this is something that is immediately obvious when using the API or something, please forgive me. I only know what I can find from the manual and by searching, and I want to know everything 100% before I start moving data to Neo4j.
Upvotes: 2
Views: 185
Reputation: 4392
It is the same with neo4j, node and relationship ids are persistent during their lifetime, but reused (see e.g. the note in the cypher manual.
So while you can use the internal id, the prefered way is not to present them to use them in external systems and use generated application ids instead.
Upvotes: 3