nerdexam
Google

PROFESSIONAL-CLOUD-DEVELOPER · Question #178

You are building a mobile application that will store hierarchical data structures in a database. The application will enable users working offline to sync changes when they are back online. A…

The correct answer is C. Use Firestore in Native mode and assign the roles/datastore.user role to the service account. Firestore in Native mode is the ideal database for this use case for three reasons: (1) it natively supports hierarchical document data structures, (2) it provides built-in offline sync and real-time sync capabilities for mobile clients, and (3) it scales seamlessly as a…

Implementing Data Storage Solutions

Question

You are building a mobile application that will store hierarchical data structures in a database. The application will enable users working offline to sync changes when they are back online. A backend service will enrich the data in the database using a service account. The application is expected to be very popular and needs to scale seamlessly and securely. Which database and IAM role should you use?

Options

  • AUse Cloud SQL, and assign the roles/cloudsql.editor role to the service account.
  • BUse Bigtable, and assign the roles/bigtable.viewer role to the service account.
  • CUse Firestore in Native mode and assign the roles/datastore.user role to the service account.
  • DUse Firestore in Datastore mode and assign the roles/datastore.viewer role to the service

How the community answered

(37 responses)
  • A
    5% (2)
  • B
    8% (3)
  • C
    84% (31)
  • D
    3% (1)

Explanation

Firestore in Native mode is the ideal database for this use case for three reasons: (1) it natively supports hierarchical document data structures, (2) it provides built-in offline sync and real-time sync capabilities for mobile clients, and (3) it scales seamlessly as a serverless NoSQL database. The roles/datastore.user role grants the backend service account read/write access needed to enrich data. Cloud SQL (A) is relational and does not support offline mobile sync. Bigtable (B) is a wide-column store optimized for high-throughput analytics, not mobile offline sync, and roles/bigtable.viewer is read-only. Firestore in Datastore mode (D) does not support the offline real-time sync needed by mobile clients, and roles/datastore.viewer is read-only so the backend cannot write.

Topics

#Firestore#NoSQL Databases#Mobile Development#IAM Roles

Community Discussion

No community discussion yet for this question.

Full PROFESSIONAL-CLOUD-DEVELOPER Practice