Cloud Storage ဆိုတာဘာလဲ?
Cloud Storage က user upload လုပ်တဲ့ files တွေကိုသိမ်းဖို့ Firebase service ဖြစ်ပါတယ်။ Profile avatar, product image, PDF, audio, video, receipt image စတာတွေကိုသိမ်းနိုင်ပါတယ်။ Firestore က text/data သိမ်းဖို့ကောင်းပြီး Storage က file သိမ်းဖို့ကောင်းပါတယ်။
Firestore နှင့် Storage ကို တွဲသုံးပုံ
Image file ကို Storage ထဲတင်ပြီး ရလာတဲ့ download URL သို့မဟုတ် file path ကို Firestore document ထဲမှာသိမ်းပါ။ ဥပမာ user profile document ထဲမှာ avatarUrl field ထည့်ထားနိုင်ပါတယ်။
သတိထားရန်
Upload file size, file type, access permission ကို မစစ်ဘဲထားရင် storage cost တက်နိုင်ပြီး မလိုလားတဲ့ file တွေဝင်လာနိုင်ပါတယ်။ Client-side validation + Security Rules နှစ်ခုလုံးလိုအပ်ပါတယ်။