0
0
Firebasecloud~20 mins

Realtime Database vs Firestore decision in Firebase - Practice Questions

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Firebase Database Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
Choosing the right database for hierarchical data

You have a mobile app that stores deeply nested user settings and preferences. Which Firebase database is best suited for this use case?

ARealtime Database, because it supports complex queries on nested data out of the box.
BFirestore, because it stores data in collections and documents, which is better for deeply nested JSON.
CRealtime Database, because it handles hierarchical data with low latency and simple JSON structure.
DFirestore, because it uses a flat JSON tree that automatically flattens nested data.
Attempts:
2 left
💡 Hint

Think about which database uses a JSON tree structure natively and is optimized for nested data.

service_behavior
intermediate
2:00remaining
Handling offline data synchronization

Which Firebase database provides built-in offline support for web clients that automatically syncs data when the connection is restored?

ARealtime Database, but requires manual sync logic on web clients.
BFirestore, but only on mobile clients, not web clients.
CRealtime Database, because it caches data locally and syncs changes automatically when online.
DFirestore, because it supports offline persistence and sync on web and mobile clients.
Attempts:
2 left
💡 Hint

Consider which database supports offline persistence on all client platforms including web.

Architecture
advanced
2:30remaining
Scaling a chat application with many users

You are designing a chat app with millions of users and thousands of messages per second. Which Firebase database is more suitable to handle this scale efficiently?

AFirestore, because it scales automatically with better query performance and supports sharding.
BRealtime Database, because it supports high throughput with simple JSON data and low latency.
CRealtime Database, because it has built-in horizontal scaling across regions.
DFirestore, but it requires manual sharding to handle high write throughput.
Attempts:
2 left
💡 Hint

Think about which database is designed for automatic scaling and complex queries at large scale.

security
advanced
2:30remaining
Implementing granular security rules

You want to restrict user access to only their own data with fine-grained control. Which Firebase database offers more expressive security rules for this purpose?

AFirestore, but security rules are limited to collection-level permissions only.
BFirestore, because its security rules support granular document-level access and complex expressions.
CRealtime Database, but it only supports simple read/write rules without conditions.
DRealtime Database, because its security rules allow complex conditions on JSON paths.
Attempts:
2 left
💡 Hint

Consider which database allows security rules at the document level with complex logic.

Best Practice
expert
3:00remaining
Optimizing cost for a read-heavy app

Your app has millions of users mostly reading data with few writes. Which Firebase database choice and strategy will minimize costs?

AUse Firestore with indexed queries and pagination to reduce document reads.
BUse Realtime Database with shallow queries to limit data downloaded per read.
CUse Realtime Database with frequent full data syncs to cache data locally.
DUse Firestore without indexes to reduce storage costs.
Attempts:
2 left
💡 Hint

Think about how Firestore charges per document read and how indexing affects query efficiency.