Which of the following best explains why applications use file storage services like Firebase Storage?
Think about what kind of data is best kept outside of databases.
File storage services are designed to efficiently store large binary files like images and videos. Databases are better suited for structured data, not large files.
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?
Consider the size and type of data each service is designed to handle.
Firebase Storage is built to handle large files efficiently, while Firestore is designed for structured data and has size limits per document.
Which Firebase Storage security rule ensures that only authenticated users can upload files to their own user folder?
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;
}
}
}Look at the conditions for write and read permissions in the rule.
The rule allows writes only if the user is authenticated and the user ID matches the folder name. Reads are denied for all.
What happens when you upload a file to Firebase Storage with the same path as an existing file?
Think about how cloud storage handles files with identical paths.
Uploading a file to the same path replaces the existing file content in Firebase Storage.
Which strategy best helps reduce Firebase Storage costs for an app with many user-uploaded images?
Consider how to manage storage space and data efficiently.
Keeping only metadata in Firestore and images in Storage with lifecycle rules helps manage storage costs and data efficiently.