Featured resource
2025 Tech Upskilling Playbook
Tech Upskilling Playbook

Build future-ready tech teams and hit key business milestones with seven proven plays from industry leaders.

Check it out
  • Lab
    • Libraries: If you want this lab, consider one of these libraries.
    • Cloud
Labs

Creating Google Cloud Firestore Collections and Documents

You are tasked with developing a small web app to track a list of famous computer scientists. You want to store the details in a NoSQL document store so that you can interact with database records as JSON documents. If this app ever needs to scale, you need the database to be strongly consistent and globally available. To achieve this, you will create a Cloud Firestore database and connect to it with a Python Flask web app that runs in the Cloud Run serverless platform.

Lab platform
Lab Info
Level
Beginner
Last updated
Sep 23, 2025
Duration
30m

Contact sales

By filling out this form and clicking submit, you acknowledge our privacy policy.
Table of Contents
  1. Challenge

    Activate Cloud Shell and the Required APIs
    1. From inside the GCP dashboard, load the Cloud Shell terminal. Your project should already be active in the terminal (highlighted in yellow), but if it isn't, enter the following code using your project ID, which is located next to the Google Cloud Platform title at the top of the GCP dashboard:
      gcloud config set project <YOUR_PROJECT_ID>
      
    2. In the Cloud Shell terminal, using gcloud, activate the following APIs, which are required for this lab:
      • run.googleapis.com
      • cloudbuild.googleapis.com
      • containerregistry.googleapis.com
    3. Configure these settings for Cloud Run using gcloud config:
      • Set the region to us-east1
      • Set the platform to managed
  2. Challenge

    Create a Firestore Collection and Documents

    For this objective, we need to:

    1. Create a new Firestore database that is set to Native Mode and located in us-east1.
    2. Start a collection with the Collection ID of compscientists.
    3. Create the first document with the following information set on three lines:
    • Line one:
      • Field name: first
      • Field type: string
      • Field value: Ada
    • Line two:
      • Field name: last
      • Field type: string
      • Field value: Lovelace
    • Line three:
      • Field name: birthyear
      • Field type: number
      • Field value: 1815
    1. Create a second document for Alan Turing, born in 1912, using the same formatting from before for Field name and Field type, and update the Filed value with his information.
  3. Challenge

    Deploy and Test the Flask Application

    For this objective, you need your GCP project ID, which can be found next to the Google Cloud Platform title on the GCP dashboard:

    1. Clone the necessary git repo to get the Flask application code. This is our repo: https://github.com/linuxacademy/content-google-certified-pro-cloud-developer
    2. Change to the flask-firestore directory.
    3. Build the demo app using gcloud, --tag, gcr.io, and our project ID. Make sure to place it in the flask-firestore directory.
    4. Deploy flask-firestore to Cloud Run using --image, gcr.io, and our project ID. Make sure it is placed in our flask-firestore directory without having to be authenticated.
    5. Use the returned URL for your newly deployed app.
    6. Browse the URL and view the demo page listing the documents in the collection.
    7. Add a new computer scientist (perhaps yourself!) to the collection using the web app's form. Make sure you use proper names and a real year, as there is no exception handling in this web app.
    8. Check that the new document is listed both in the web app and in GCP.
About the author

Pluralsight Skills gives leaders confidence they have the skills needed to execute technology strategy. Technology teams can benchmark expertise across roles, speed up release cycles and build reliable, secure products. By leveraging our expert content, skill assessments and one-of-a-kind analytics, keep up with the pace of change, put the right people on the right projects and boost productivity. It's the most effective path to developing tech skills at scale.

Real skill practice before real-world application

Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.

Learn by doing

Engage hands-on with the tools and technologies you’re learning. You pick the skill, we provide the credentials and environment.

Follow your guide

All labs have detailed instructions and objectives, guiding you through the learning process and ensuring you understand every step.

Turn time into mastery

On average, you retain 75% more of your learning if you take time to practice. Hands-on labs set you up for success to make those skills stick.

Get started with Pluralsight