hands-on lab

Working with Advanced Components in Cloud Firestore in Datastore Mode

Difficulty: Intermediate
Duration: Up to 45 minutes
Students: 29
Rating: 5/5
Get guided in a real environmentPractice with a step-by-step scenario in a real, provisioned environment.
Learn and validateUse validations to check your solutions every step of the way.
See resultsTrack your knowledge and monitor your progress.

Description

When you need to build a NoSQL solution for your application, considering a document-based database could be a winning solution. Sometimes you want to better organize your documents, and having a powerful query language that can perform queries in milliseconds. Firestore in Datastore mode perfectly suits this scenario.

Firestore in Datastore mode offers you the possibility to organize the documents leveraging ancestors. It means you can create hierarchies with documents, so you can better organize your documents avoiding having only flat documents. Firestore in Datastore mode also provides you GQL, a powerful SQL-like query language you can use to query the NoSQL database. Of course you can query the key of your documents, but if you need to query the properties, Firestore gives you the possibility to create indexes attached to them so query will be optimized.

In this lab, you will use Firestore in Datastore mode to create a NoSQL database, entities with hierarchic kinds and indexed properties, and you will finally perform some GQL queries.

Learning Objectives

Upon completion of this lab, you will be able to:

  • Organize documents in hierarchies
  • Create entities with an index
  • Perform GQL queries

Intended Audience

  • Google Cloud Professional Data Engineer (PDE) candidates
  • Data engineers who want to deep leverage the components offered by Firestore
  • Software engineers curious about the possible scenarios achievable using Firestore

Prerequisites

To get the most from this lab, you should be familiary with Firestore in Datastore mode. The following lab can be followed:

Environment before

Environment after

Covered topics

Lab steps

Signing In to the Google Cloud Console
Creating a New Firestore Database
Creating Hierarchic Entities with Indexed Properties
Querying a Firestore Database Using GQL