How to create multi environment DB's with Firestore

Dyan picture Dyan · Feb 6, 2018 · Viewed 9.7k times · Source

I've been looking at how to create multiple Firestore instances in Firebase, I need different Db's for prod, staging and development. I read the documentation and seems that I only need to modify the "Google-services.json" file in the applications. what I don't get is what should I modify and how that would look in the console.

  • Am I going to see different instances in the same project?

  • I need to create different projects for every environment and modify those values in the file?

  • If I need to test something that requires testing in all environments and all of them require Blaze to run that test do I have to pay Triple?

Thanks in advance

Answer

Doug Stevenson picture Doug Stevenson · Feb 6, 2018

Firebase doesn't support the use of multiple Firestore instances in a single project.

The Firebase team strongly recommends creating different projects for each of your environments to keep them separate. This probably means you will have to build different apps that each point to different instances, or you will have to somehow configure your app at runtime to select which project you want to work with.

There is no obligation to add billing to any of the projects you don't want to pay for, as long as you accept the limitations of the Spark plan.