Google Cloud Professional Cloud Developer — Question 283
You are developing a mobile application that allows users to create and manage to-do lists. Your application has the following requirements:
• Store and synchronize data between different mobile devices.
• Support offline access.
• Provide real-time updates on each user's device.
You need to implement a database solution while minimizing operational effort. Which approach should you use?
Answer options
- A. Create a Cloud SQL for MySQL instance. Implement a data model to store to-do list information. Create indexes for the most heavily and frequently used queries.
- B. Create a Bigtable instance. Design a database schema to avoid hotspots when writing data. Use a Bigtable change stream to capture data changes.
- C. Use Firestore as the database. Configure Firestore offline persistence to cache a copy of the Firestore data. Listen to document changes to update applications whenever there are document changes.
- D. Implement a SQLite database on each user's device. Use a scheduled job to synchronize each device database with a copy stored in Cloud Storage.
Correct answer: C
Explanation
The correct answer is C because Firestore provides built-in support for offline persistence and real-time updates, making it ideal for mobile applications that require synchronization and offline access. While option A offers a robust SQL solution, it does not inherently support offline capabilities. Option B, using Bigtable, is more suited for large-scale analytics rather than real-time updates for mobile apps. Option D relies on local synchronization, which increases complexity and operational effort.