Reputation: 34014
I'm currently working on a social platform where users create posts similar to Facebook or Linkedin. So what I'm trying to achieve is, whenever user create a post they may upload images as part of the post and I want to store them in firebase storage but what I'm not clear is, what type of storage path I should choose from one of the below for uploading images.
Which option is right for user posts from the below?
I'm using Firebase storage and database for this app.
Upvotes: 0
Views: 204
Reputation: 599946
There is no singular correct or best approach here, it all depends on your app's needs and use-cases.
I typically would use a folder structure with /images/$uid/$postid
, for example because it makes it easy for me to delete all images for a specific user, as well as all images for a specific post. But as you can see from that description, that calls out two specific use-cases that might or might not be relevant for your app.
Upvotes: 1