Node property or edges

If I have many nodes that are all associated with an ID. Is it better to create a node with that ID and connect it to the aforementioned nodes? Or is it better to add this ID as an attribute to all the nodes?

In terms of querying performance, what would yield better performance?

That’s a good question,

For once having that ID as an attribute would allow you to create an index over it, on the other hand if you create a single node representing that ID you can treat it as a representative to all of the other nodes, this might be beneficial for queries such as: “is there a node with given ID that is connected to some pattern?” where you don’t really care for the specific node but only interested in known if there’s one.

Bottom line, there’s no obvious answer here, it all comes down to the queries you would like to run.