Can security rules impact bandwidth?

106 views
Skip to first unread message

Daxno

unread,
Nov 10, 2015, 8:41:18 PM11/10/15
to Firebase Google Group
I've noticed a steep rise in outgoing bytes ever since I added a bunch of security rules to my firebase collection.
The added security rules are pretty large/comprehensive and check if certain values are set when firebase is trying to access a location (e.g. allow read when root[name][of][path] === true).
Is it at all possible that these rules can cause the bandwidth change?

Piotr Kaminski

unread,
Nov 10, 2015, 8:47:56 PM11/10/15
to fireba...@googlegroups.com
Are you by any chance using a debut token to authenticate?  This causes a report of all rule checks to be sent back to the client and can significantly affect bandwidth.

Otherwise, I haven't personally seen any impact from my 175KB of rules on bandwidth usage.

    -- P.


--
You received this message because you are subscribed to the Google Groups "Firebase Google Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-tal...@googlegroups.com.
To post to this group, send email to fireba...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-talk/166c323c-70c0-4074-a279-0f8cce99fcb2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
  Piotr Kaminski <pi...@ideanest.com>
  "That bun is dirty.  Don't eat that bun."

Daxno

unread,
Nov 12, 2015, 8:01:16 PM11/12/15
to Firebase Google Group
I'm not using a debug flag or custom auth in general, only password auth.
My security rules are about 350KB (after compilation by Blaze), so they are pretty big.
My dev. firebase database is only 100KB large, yet my bandwidth usage is a steady 80 to 120 MB a day!
This seems a bit much, given the fact I'm the only person accessing the database (which is also reflected by the 'concurrent connections' stat).
I'm worried the bandwidth will explode once I launch the app and more people start using it. If each user needs 120MB of bandwidth a day, that could become a problem.

Could the high bandwidth usage be explained by the live-reload mechanisme I use to develop the app (each time I save a code change the app refreshes automatically, thus reconnecting to firebase)?
I personally don't hink that would explain it, because I would have to refresh and reconnect about 1200 times a day to get to 120 MB.
I've also been looking for memory leaks (e.g. refs which don't get destroyed), but haven't been able to find any.
So I'm still wondering if the security rules might be responsible for the high bandwidth usage. Is there anyone from the Firebase team willing to give me there opinion about this? Thanks!
Reply all
Reply to author
Forward
0 new messages