0
votes

I have such a firebase data and rule structure:

enter image description here

So...my firebase data downloads are very high..almost 1GB per day. (300 users, 3,5MB database size) I think the reason for this is that the user downloads the whole database to get to the "users/$uid" section. It only requires data from the $uid area. How is it possible not to download the other data about it?

My database ref in code

Like: this.dataObjRef = this.afDatabase.object("data/users/${uid}");

What I tried

I tried to set ".read" : "false" directly in the rules above, but then none of the data is accessible, although ".write" at the bottom of the says "$uid": "$uid === auth.uid"

Do you have any idea?

1
The line of code you showed will only download data for that precise path /data/users/${uid}. To learn what a single client reads, you can profile your database: firebase.google.com/docs/database/usage/profileFrank van Puffelen

1 Answers

0
votes

You can keep your data in client instead of download data every time Disk Persistence

But it doesn't look high data use in their. Maybe your code have some unusual query?