
Answer-first summary for fast verification
Answer: 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.
Firestore is the optimal choice for this scenario due to its built-in capabilities for real-time data synchronization and offline access. It automatically handles the complexities of data synchronization across devices, providing real-time updates to all users. Its offline persistence feature ensures that users can access and modify their to-do lists even without an internet connection, with changes being synchronized once connectivity is restored. This approach significantly reduces the operational effort required to meet the application's requirements, unlike the other options which either lack real-time updates or require manual synchronization logic.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
You are developing a mobile app for creating and managing to-do lists with these requirements:
You must implement a database solution with minimal operational overhead. Which approach is best?
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.
No comments yet.