A data science team is developing a recommendation engine that needs to perform real-time feature lookups for millions of users. The engine requires a database that can store complex, semi-structured user profiles and item metadata, support fast key-value lookups (sub-10ms latency), and scale globally. The data is frequently updated but doesn't require strong transactional consistency across multiple records. Which Google Cloud service is the most suitable for this use case?
- ABigQuery
- BCloud Spanner
- CFirestore
- DCloud SQL
Show answer & explanationAnswer & explanation
Correct answer: C. Firestore
Firestore is a NoSQL document database that is excellent for storing semi-structured data like user profiles and item metadata. It offers sub-10ms latency for key-value lookups, scales globally as a fully managed service, and is designed for applications requiring flexible schemas and real-time updates without strict transactional consistency across multiple documents, making it ideal for recommendation engines.
Why the other options are wrong
- A. BigQuery is an analytical data warehouse, optimized for complex queries on large datasets, not for low-latency operational lookups of individual user profiles.
- B. Cloud Spanner provides global consistency for relational data, but it is typically overkill and more expensive for semi-structured document data requiring sub-10ms key-value lookups without strict transactional needs across multiple documents.
- D. Cloud SQL is a relational database, not ideal for semi-structured data or the global scale and ultra-low latency key-value lookups required for a real-time recommendation engine.
Firestore for Real-time Feature Serving
A flexible, scalable NoSQL document database on Google Cloud, providing low-latency access to semi-structured data, suitable for real-time application features like recommendation engines and user profiles.
- NoSQL document model, flexible schema.
- Scales globally and is fully managed.
- Sub-10ms latency for point reads/writes.
- Supports real-time synchronization and offline capabilities.
- Ideal for user profiles, game states, and catalog data.
Memory trick: To feed a 'Fire' fast recommendation engine with user 'Stories', you need a database that's quick, flexible, and always available.