[Realtime Database]Does data type affect the performance or the amount of storage

143 views
Skip to first unread message

Tomohiko Himura

unread,
Mar 9, 2017, 10:07:13 AM3/9/17
to Firebase Google Group

Hi.


Does data type affect the performance or the amount of storage in the Firebase Realtime Database?  

If it does, are there any trade offs between performance and storage amount on choosing data types in Firebase Realtime Database?
For example, between boolean, numeric and string values, I believe that

  • boolean can save the storage more than numeric values but numeric values can represent multiple values more than two
  • string is more powerful representation than numerics but numerics can have better performance than strings, etc.

I would like to understand if there is such characteristic.


Kato Richardson

unread,
Mar 9, 2017, 1:29:53 PM3/9/17
to Firebase Google Group
Hi Tomohiko,

I can't go into too much detail about Firebase on the storage layer, as I really don't know which aspects of the underlying infrastructure are proprietary and confidential (probably most) and which are in the public domain.

Keep in mind that the Realtime Database is schemaless, so it only makes sense we would store your data as documents rather than trying to infer a schema onto the underlying tooling, so the individual types are unlikely to matter much, if at all (and I'm sure it's closer to not at all).

☼, Kato


--
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-talk+unsubscribe@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/c5e04287-03dc-45f5-94b9-c783ce3eebeb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--

Kato Richardson | Developer Programs Eng | kato...@google.com | 775-235-8398

Tyler Rockwood

unread,
Mar 10, 2017, 10:58:20 AM3/10/17
to Firebase Google Group
To piggyback off Kato: in terms of storage amount and pricing, you're billed on the *JSON size* of your data, so true accounts for 4 bytes, the number 1 accounts for a single byte, the number 4242 accounts for 4 bytes, and the string "foo" accounts for 5 bytes (includes the quotes).

Hope that helps!

-Tyler


On Thursday, March 9, 2017 at 10:29:53 AM UTC-8, Kato Richardson wrote:
Hi Tomohiko,

I can't go into too much detail about Firebase on the storage layer, as I really don't know which aspects of the underlying infrastructure are proprietary and confidential (probably most) and which are in the public domain.

Keep in mind that the Realtime Database is schemaless, so it only makes sense we would store your data as documents rather than trying to infer a schema onto the underlying tooling, so the individual types are unlikely to matter much, if at all (and I'm sure it's closer to not at all).

☼, Kato

On Thu, Mar 9, 2017 at 2:04 AM, Tomohiko Himura <eiel...@gmail.com> wrote:

Hi.


Does data type affect the performance or the amount of storage in the Firebase Realtime Database?  

If it does, are there any trade offs between performance and storage amount on choosing data types in Firebase Realtime Database?
For example, between boolean, numeric and string values, I believe that

  • boolean can save the storage more than numeric values but numeric values can represent multiple values more than two
  • string is more powerful representation than numerics but numerics can have better performance than strings, etc.

I would like to understand if there is such characteristic.


--
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/c5e04287-03dc-45f5-94b9-c783ce3eebeb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Tomohiko Himura

unread,
Mar 10, 2017, 10:58:21 AM3/10/17
to Firebase Google Group
I think so, too. I wanted to confirm because the size of the amount of data to be stored was likely to increase.

Thank you.

2017年3月10日金曜日 3時29分53秒 UTC+9 Kato Richardson:
Hi Tomohiko,

I can't go into too much detail about Firebase on the storage layer, as I really don't know which aspects of the underlying infrastructure are proprietary and confidential (probably most) and which are in the public domain.

Keep in mind that the Realtime Database is schemaless, so it only makes sense we would store your data as documents rather than trying to infer a schema onto the underlying tooling, so the individual types are unlikely to matter much, if at all (and I'm sure it's closer to not at all).

☼, Kato

On Thu, Mar 9, 2017 at 2:04 AM, Tomohiko Himura <eiel...@gmail.com> wrote:

Hi.


Does data type affect the performance or the amount of storage in the Firebase Realtime Database?  

If it does, are there any trade offs between performance and storage amount on choosing data types in Firebase Realtime Database?
For example, between boolean, numeric and string values, I believe that

  • boolean can save the storage more than numeric values but numeric values can represent multiple values more than two
  • string is more powerful representation than numerics but numerics can have better performance than strings, etc.

I would like to understand if there is such characteristic.


--
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/c5e04287-03dc-45f5-94b9-c783ce3eebeb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Tomohiko Himura

unread,
Mar 12, 2017, 11:24:36 PM3/12/17
to Firebase Google Group
> you're billed on the *JSON size* of your data, so true accounts for 4 bytes, the number 1 accounts for a single byte, the number 4242 accounts for 4 bytes, and the string "foo" accounts for 5 bytes (includes the quotes).

It is amazing. Thank you very much.

2017年3月11日土曜日 0時58分20秒 UTC+9 Tyler Rockwood:
Reply all
Reply to author
Forward
0 new messages