Hey there, I saw several topics about this point on the net but I never found exactly if I should prefer random or custom _id.
Is there anyone that can explain it to me? Furthermore, Is there any difference between a creation document and an update document using random or custom _id?
Indexing documents with an auto generated id is more efficient than using a custom id so is ideal for immutable data. If you want to update data you may benefit from a custom id as updating gets easier and you do not need to search for the id first.
Regarding update procedure. Using a custom _id is probably better I know from the beginning the document that I want to update, while with a random _id I should search it with a query? Am I right?
In your opinion, executing a query (first operation) to get the random _id to be updated (second operation) is more expensive (cpu/jvm) than updating directly the document with the custom _id?
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.