0
0
Firebasecloud~20 mins

Why file storage is needed in Firebase - Challenge Your Understanding

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
File Storage Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
Why do applications need file storage?

Which of the following best explains why applications use file storage services like Firebase Storage?

ATo automatically convert files into database entries for easier querying.
BTo replace databases entirely for storing all types of data including structured records.
CTo store and retrieve large files such as images, videos, and documents that databases are not optimized for.
DTo run application code directly on the storage servers for faster processing.
Attempts:
2 left
💡 Hint

Think about what kind of data is best kept outside of databases.

Architecture
intermediate
2:00remaining
Choosing file storage for user uploads

You are building a mobile app where users upload photos and videos. Why should you use Firebase Storage instead of saving files directly in Firestore database?

ABecause Firestore automatically compresses files which can cause data loss.
BBecause Firebase Storage is optimized for large file uploads and downloads, providing better performance and cost efficiency.
CBecause Firebase Storage encrypts files but Firestore does not support encryption.
DBecause Firestore limits the number of files you can upload per user.
Attempts:
2 left
💡 Hint

Consider the size and type of data each service is designed to handle.

security
advanced
2:30remaining
Securing file access in Firebase Storage

Which Firebase Storage security rule ensures that only authenticated users can upload files to their own user folder?

Firebase
service firebase.storage {
  match /b/{bucket}/o {
    match /user_uploads/{userId}/{allPaths=**} {
      allow write: if request.auth != null && request.auth.uid == userId;
      allow read: if false;
    }
  }
}
AOnly authenticated users can read and write files in any folder.
BNo one can write or read files in the storage.
CAnyone can write files to any folder; only authenticated users can read files.
DOnly authenticated users can write files to their own folder; no one can read files.
Attempts:
2 left
💡 Hint

Look at the conditions for write and read permissions in the rule.

service_behavior
advanced
2:00remaining
Firebase Storage behavior on file overwrite

What happens when you upload a file to Firebase Storage with the same path as an existing file?

AThe existing file is overwritten with the new file content.
BFirebase Storage creates a duplicate file with a numeric suffix.
CThe upload fails with an error indicating the file already exists.
DThe existing file is archived and the new file is saved separately.
Attempts:
2 left
💡 Hint

Think about how cloud storage handles files with identical paths.

Best Practice
expert
3:00remaining
Optimizing costs with Firebase Storage

Which strategy best helps reduce Firebase Storage costs for an app with many user-uploaded images?

AStore only image metadata in Firestore and keep images in Firebase Storage with lifecycle rules to delete unused files.
BStore all images directly in Firestore documents as base64 strings to avoid storage costs.
CDisable Firebase Storage and use Firestore exclusively for all data including files.
DUpload duplicate copies of images to multiple storage buckets for backup.
Attempts:
2 left
💡 Hint

Consider how to manage storage space and data efficiently.