Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Multiple instance of Firestore in same project

Firebase Firestore doesn't support multiple instance in a single project. We need to create multiple instance for different environment.

Need recommendation how other manage such situation?

There is a limit of 10,000 write/second. When our database grow, we need to create new production project to have another 10,000 write/second limit. Request Firestore team to allow us to create multiple instance in single project.

Solved Solved
0 1 7,448
1 ACCEPTED SOLUTION

Hello,

You can still achieve your goal of having separate "instances" in a few ways. The most basic is to create another project and have one of the Firestore instances in that second project. You can connect multiple Firestore instances to a single Firebase app [1]. Another option is to use sub-collections within a single Firestore instance, as described here [2].

Another option is to use Realtime Database instead, since it allows you to have multiple databases per project, but it has some limitations around scalability compared to Firestore. You can see a more detailed comparison here [3].

Here [4] is a short description of subcollections from our public documentation. But I think this video [5] might be more helpful at describing when you would use subcollections, so you can compare with your use case.

[1] https://firebase.google.com/docs/projects/multiprojects
[2] https://groups.google.com/g/firebase-talk/c/dOs2IOOkg04/m/-rSSadkIAwAJ
[3] https://firebase.google.com/docs/database/rtdb-vs-firestore

[4] https://firebase.google.com/docs/firestore/data-model#subcollections
[5] https://youtu.be/o7d5Zeic63s

View solution in original post

1 REPLY 1

Hello,

You can still achieve your goal of having separate "instances" in a few ways. The most basic is to create another project and have one of the Firestore instances in that second project. You can connect multiple Firestore instances to a single Firebase app [1]. Another option is to use sub-collections within a single Firestore instance, as described here [2].

Another option is to use Realtime Database instead, since it allows you to have multiple databases per project, but it has some limitations around scalability compared to Firestore. You can see a more detailed comparison here [3].

Here [4] is a short description of subcollections from our public documentation. But I think this video [5] might be more helpful at describing when you would use subcollections, so you can compare with your use case.

[1] https://firebase.google.com/docs/projects/multiprojects
[2] https://groups.google.com/g/firebase-talk/c/dOs2IOOkg04/m/-rSSadkIAwAJ
[3] https://firebase.google.com/docs/database/rtdb-vs-firestore

[4] https://firebase.google.com/docs/firestore/data-model#subcollections
[5] https://youtu.be/o7d5Zeic63s