How to create separate bucket for multiple user in firebase

How to create separate bucket for user ,if my app is download 500 people so how to store all user data in separate bucket like user1,user2,user3…user500.
I have created this to manually but how to create this to automatic if user fill our all details then create user 5 and show data like this
image

[Mod Edit: cropped image to remove personally identifiable information]

Very simple @Aditya_mishra ,

When the user hits on submit/any button you assigned to send data to fireDB,

  1. Call firebase tag list
  2. And count the length of the tag list
  3. Then set firebase project bucket as user+length of the tag list+1
  4. Now use the firebase save block with desired tag and values.

Got it? Or need blocks?

It would be efficient to have your users log in with some credentials, and then use the UID as the bucket. Firebase Realtime Database even has something of this sort in the Documentation.

Need block ,I have tried many times but can’t understand so please I need block image

From Firebase Realtime Database security documentation:


Implement Firebase Auth, and use UID to have separate buckets.

try like this but create Userdetails and User1 detail alone in the firebase DB,
remaining things this block will see

image

My block will count the existing length of the tag under UserDetails. So keep in mind that after suing this block you should not add any tag in this else this block will count that tag too

image

I repeat. To start this process manually we have to create User details> User1 details alone in the app. If not it will not function

Update
The above code adds data in my firebase as bellow,

image

The same person would thus create a new tag every time they reinstall the app.


@Aditya_mishra I highly recommend you follow the firebase documentation I shared. Otherwise you are disclosing personal information of your users. You need to have proper security to safeguard that.

1 Like

It can be prevented by using additional blocks.

And I have answered according to his query also if he seeks further or disclose the whole detail we can suggest him. Firebase authendication and the rules sometime really hard to understand.

Don’t worry my Firebese database pic is manually not a any user information its a demo information I fill in randomly to show you how to create like that

Hi, if this guide tellls how to store data with separate bucket, i want to ask how to show or read the data that we’ve store before?

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.