Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
April 9, 2022 05:14 pm GMT

Firebase limits doc fields

Today I ill be figuring out the max amount of items a single firestore doc can have and why that is a problem.

The problem

We all know how limiting firestore is, but don't get me wrong the developer experience is amazing just plop down some functions to create read and update data it's super easy and simple.

Firestore sucks at relational data at scale. One way to represent relationships is having other document ids and embed it into the document, but truly how many document ids can fit into one document.

Image description

The answer is that each firestore document can have at max 19999 different items in a document after that many items adding anything else does not work.

You might ask who would need that many items in a single document. Well features like followers where you grab the others user uid to show a follower and followee relationship is impossible unless you add more documents to show the relationship where it could check first document then second document with a list of uids. But that is clunky and doesn't work well.

So unless the firebase team can do something better for relational data firestore is an inadequate option for large scale relational data.


Original Link: https://dev.to/neoprint3d/firebase-limits-doc-fields-19jk

Share this article:    Share on Facebook
View Full Article

Dev To

An online community for sharing and discovering great ideas, having debates, and making friends

More About this Source Visit Dev To