0
0
Firebasecloud~20 mins

Multi-tenancy patterns in Firebase - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Multi-tenancy Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
Understanding Multi-tenancy Isolation Levels

In Firebase multi-tenancy, which isolation level best ensures that data from one tenant cannot be accessed by another tenant?

AShared database with tenant ID filtering in queries
BSingle Firestore collection with tenant data mixed
CShared Firebase project with different Firestore collections per tenant
DSeparate Firebase projects for each tenant
Attempts:
2 left
💡 Hint

Think about physical separation of data and access control.

Architecture
intermediate
2:00remaining
Choosing a Multi-tenancy Data Model in Firestore

You want to design a Firestore database for multiple tenants. Which data model allows easy querying of tenant-specific data while minimizing data duplication?

AOne collection per tenant with duplicated structure
BSingle collection with tenant ID field in each document
CSeparate Firestore projects per tenant
DSingle collection with tenant data mixed without tenant ID
Attempts:
2 left
💡 Hint

Consider how queries filter data efficiently.

security
advanced
2:30remaining
Securing Tenant Data with Firebase Security Rules

Given a Firestore collection 'orders' where each document has a 'tenantId' field, which Firebase security rule correctly restricts read access to documents belonging only to the authenticated tenant?

match /orders/{orderId} {
  allow read: if ... ;
}
Arequest.auth.token.tenantId == resource.data.tenantId
Brequest.auth.uid == resource.data.tenantId
Cresource.data.tenantId == 'tenant123'
Drequest.auth.token.email == resource.data.tenantId
Attempts:
2 left
💡 Hint

Check how tenant identity is passed in the authentication token.

service_behavior
advanced
2:00remaining
Behavior of Firebase Functions in Multi-tenant Setup

In a multi-tenant Firebase app using a single project, what happens if a Cloud Function does not check tenant identity before processing a request?

AFunction runs only for the first tenant that called it
BFunction automatically restricts access to the calling tenant's data
CFunction processes requests for all tenants without restriction
DFunction throws an authentication error
Attempts:
2 left
💡 Hint

Consider default behavior without explicit tenant checks.

Best Practice
expert
3:00remaining
Optimizing Cost and Performance in Firebase Multi-tenancy

You manage a Firebase app serving multiple tenants with varying usage patterns. Which multi-tenancy pattern best balances cost efficiency and performance?

ASingle Firebase project with tenant ID filtering and Firestore rules
BSeparate Firebase projects per tenant regardless of size
CSingle Firebase project with duplicated collections per tenant
DShared Firebase project with no tenant separation
Attempts:
2 left
💡 Hint

Think about managing resources and scaling efficiently.