GCP Series: HOWTO: Serverless NoSQL : Firestore Cheatsheet

3 years ago   •   2 min read

By CloudNerve.com

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.

Firestore

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

collections

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.

Spread the word