Skip to content Skip to sidebar Skip to footer

Difference Between Starting Firestore Emulator Through `firebase` And `gcloud`?

What is the difference between starting the firestore emulator through: firebase emulators:start --only firestore and: gcloud beta emulators firestore start Both options allow my

Solution 1:

I have been looking on the documentation for both tools and they do almost the same thing.

Using the Firebase tool you can start emulators for multiple Firebase products whereas the gcloud command allows you to start GCP emulators. Firestore is simply a product they both have in common and as such their utility should be the same or similar.

About the functionality differences, firebase provides the --import and --export-on-exit flags that allow you to save and recover data between emulated sessions. It also provides a way to visualize how the security rules are dealing with the current queries.

Apart from those functionalities I would note the different ways to setup the port and the rules file:

Notice that the Firestore emulator on GCP is on the beta stage thus it may have limited official support and may be subject to change. Also notice how, on GCP's Firestore documentation, the Firebase CLI is used instead of gcloud.

In the end you should use your preferred tool, as they both work towards the same goal of emulating Firestore. If you are already working with the Firebase CLI, I would recommend you to keep using it; if you are working with gcloud, use that.

Post a Comment for "Difference Between Starting Firestore Emulator Through `firebase` And `gcloud`?"