Firebase limits doc fields
Drew Ronsman

Drew Ronsman @neoprint3d

About: I'm am an enthusiastic programmer that loves to learn.

Joined:
Oct 20, 2021

Firebase limits doc fields

Publish Date: Apr 9 '22
4 0

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.

Comments 0 total

    Add comment