jsonfirebasefirebase-realtime-database

Does the child's name calculated in the Firebase Realtime Database storage?


I am creating a questionnaire app and I am thinking of using the Realtime Database, and I understand that they use JSON with the following format:

1st format:

Questions
|-Question 1. How much money did you spend last month?: "$3000"
|-Question 2: What type of expenses contributed the most to last month's expenditure?: "Rent"

To anticipate the storage cost, I wanted to make sure how it is calculated. So, I wanted to use the child name as shown above, but, will it reduce the storage if I change it to the following format:

2nd format:

Questions
|-Question 1: "$3000"
|-Question 2: "Rent"

The best thing about the first format is that I can know the exact question for No. 1 just in case the question is changed in the future.

But will it reduce the storage if I put the child's name in the second format? Does Realtime Database only calculate the child's value towards the storage?

Thanks if you have any idea about this issue.


Solution

  • You'll have to pay for bandwidth no matter if it's about the key or the value. The less you store, the less you will have to pay.

    But will it reduce the storage if I put the child's name in the second format?

    Yes, and that's because the values for those questions are much smaller than in the previous example.