Jump to Content
Developers & Practitioners

All you need to know about Firestore: A cheatsheet

July 7, 2021
https://storage.googleapis.com/gweb-cloudblog-publish/images/firestore_blog_header_banner.max-2600x2600.png
Priyanka Vergadia

Staff Developer Advocate, Google Cloud

Minh Nguyen

Senior Product Manager, Lead

Your product teams might ask - “Why does it take so long to build a feature or application?” Building applications is a heavy lift due to the technical complexity, which includes the complexity of backend services that are used to manage and store data. Every moment focused on this technical complexity is a distraction from  delivering on core business value. Firestore alters this by having Google Cloud manage your backend complexity through a complete backend-as-a-service! 

Firestore is a serverless, NoSQL document database that unlocks application innovation with simplicity, speed and confidence. 

It acts as a glue that intelligently brings together the complete Google Cloud backend ecosystem, in-app services from Firebase and core UI frameworks & OS from Google.

https://storage.googleapis.com/gweb-cloudblog-publish/images/Firestore_v06-22-2021.max-1600x1600.jpeg
Click to enlarge

What is Firestore?

Firestore is a serverless, fully managed NoSQL document database that scales from zero to global scale without configuration or downtime. Here’s what makes Firestore unique:

  • Ideal for rapid, flexible and scalable web and mobile development with direct connectivity to the database.
  • Supports effortless real time data synchronization with changes in your database as they happen. 
  • Robust support for offline mode, so your users can keep interacting with your app even when the internet isn't available or is unreliable.
  • Fully customizable security and data validation rules to ensure the data is always protected
  • Built-in strong consistency, elastic scaling, high performance & best in class 99.999% availability 
  • Integration with Firebase and Google Cloud services like Cloud Functions and BigQuery, serverless data warehouse.
  • In addition to a rich set of Google Cloud service integrations, Firestore also offers deep one-click integrations with a growing set of 3rd party partners via Firebase Extensions to help you even more rapidly build applications.

Document-model database

https://storage.googleapis.com/gweb-cloudblog-publish/images/unnamed_26.max-600x600.png

Firestore is a Document-model database. All of your data is stored in “documents” and then “collections”.  You can think of a document as a JSON object. It's a dictionary with a set of key-value mappings, where the values can be several different supported data types including strings, numbers or binary values..

These documents are stored in collections. Documents can't directly contain other documents, but they can point to subcollections that contain other documents, which can point to subcollections, and so on. This structure brings with it a number of advantages. For starters, all queries that you make are shallow, meaning that you can grab a document without worrying about grabbing all the data underneath it. And this means that you can structure your data hierarchically in a way that makes sense to you logically, without having to worry about grabbing tons of unnecessary data. 

How to use Firestore?

Firestore can be used in two modes:

  • Firestore in Native Mode:  This mode is differentiated by its ability to directly connect your web & mobile app to Firestore. Native Mode supports up to 10K writes per second, and over a million connections. 
  • Firestore in Datastore Mode: This mode supports only server-side usage of Firestore, but supports unlimited scaling, including writes. 

Conclusion

Whatever your application use case may be, if you want to build a feature or an application quickly using Firestore backend-as-a-service. For a more in-depth look into Firestore check out the documentation.
Video Thumbnail

For more #GCPSketchnote, follow the GitHub repo. For similar cloud content follow me on Twitter @pvergadia and keep an eye out on thecloudgirl.dev.

Posted in