1

I want a user to be able to press a button on a webpage and have an edge created that references the vertex.

In order to identify the vertex I could either use the Titan vertex id or a custom generated id.

Does the vertex id reveal any secrets about the database? For example, does it indicate its size? Also what if I want to recreate the database to add a forgotten index.... would this process generate all new ids and, say, break deep links to vertexes?

I'd prefer to use the db ids in order to avoid having to create custom ids and to avoid having to look up the database id from the custom id whenever I want to retrieve a vertex.

Ian Warburton
  • 15,170
  • 23
  • 107
  • 189

1 Answers1

3

The Titan ID should not change out from under you, however if you ever migrated the data in your graph to a new cluster, you would end up with all new ids, so if you tie other system too tightly to the id you might end up with a problem somewhere down the line. I'd say that would be your primary motivator for generating your own logical identifier.

That said, you might consider a design where you look up a commonly used vertex id for the scope of a users session using your logical identifier and then use the vertex id for future lookups. In that way, you avoid having to repeatedly use indices to find your vertices.

stephen mallette
  • 45,298
  • 5
  • 67
  • 135
  • Seems a shame to have to recreate id generation when the db already does it. I think I will go with the db id for now and worry about this further down the line when someone cares about my website. ;) – Ian Warburton Nov 06 '14 at 11:41
  • That's pretty common for most graph databases actually. Very few allow ID preservation. Some graphs i think even re-write the ids between restarts. I would think that generating a UUID as your a unique identifier at the time you insert your id should not be too much extra code to maintain. – stephen mallette Nov 06 '14 at 11:47
  • I think Guids look a bit unwieldily in links though. – Ian Warburton Nov 06 '14 at 12:21