Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Firestore – If I give Document ID in Alphabetical Order will it create hotspots/inefficiency?

I want to build users collection which will have Documents with IDs as A,B,C,…Z.
Each Document will contain a subcollection which will contain data of all users with starting letter A,B,…Z depending on document ID.

In Firestore documentation it is mentioned

Do not use monotonically increasing document IDs such as:
Customer1, Customer2, Customer3, …
Product 1, Product 2, Product 3, …
Such sequential IDs can lead to hotspots that impact latency.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

So Does using alphabets as Document ID create the same issue and cause hotspots or some other in efficiencies?
Thanks

>Solution :

Yes, you could observe the same effect. It’s best to use fully randomized IDs like you get if you use add() to create a new document.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading