Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Maximum size of a document in firestore?

I want create a document that containing about 20 million objects.

The structure like that:

documentID
---- key1
-------- object1
-------------name: "test1"
-------------score: 123

I don't know the limitation of a document size in firestore, so can you help me any reference or information about that? Thanks!

like image 602
TccHtnn Avatar asked Mar 07 '18 04:03

TccHtnn


People also ask

Is firestore good for big data?

If your app will be sending a stream of tiny updates, such as in a digital whiteboard app, we recommend Realtime Database. Hundreds of GBs to TBs of data that is read much more often than it is changed. For very large data sets, and when batch operations are frequently needed, we recommend Cloud Firestore.

How many documents can firestore handle?

There is no limitation on the number of documents in Firestore collection but it has a limitation of the size of the document. The maximum size of a document is roughly 1 MiB (1,048,576 bytes). Show activity on this post.


1 Answers

The maximum size is roughly 1 Megabyte, storing such a large number of objects (maps) inside of a single document is generally a bad design (and 20 million is beyond the size limit anyway).

You should reconsider why they need to be in a document, rather than each object being their own document.

Cloud Firestore's limits are listed in the documentation.

like image 96
Dan McGrath Avatar answered Oct 04 '22 03:10

Dan McGrath