Issue with Downloading All Firebase Project Data

I am using the Firebase component. The data retrieval blocks are configured based on tags and are set to fetch questions one by one. However, even though I only want to retrieve a single question, it downloads all the questions to the phone. Where am I going wrong? My “Get Question” blocks are as shown below.

Hi dear,

It would be very useful if you could also show your DB structure, because even if it’s not efficient it should still work correctly.

It would make more sense to do a single call like this


and in GotValue split the JSON you receive.
Even better would be to leave the JSON as it is and handle it as a dictionary.

Thank you for your reply.

The database structure is as shown in the image. Shouldn’t it fetch only the relevant question based on this block?

I had a bit of difficulty translating :grin:
Try to always provide info in English so it’s easier to help you,

but from what I translated:

0DenemeListesi: 0PracticeExamList
Deneme1: PracticeExam1
asoru: question
bsecenekler: choices
cevap: correctAnswer
cfnot: note

First of all, make sure you have correctly set the ProjectPath.
Then, to download a single question, you need to make a get request to the path:

sorularar/0DenemeListesi/Deneme1/X

where X is the question index

Keep in mind that if an exam doesn’t have an excessively large number of questions, it makes more sense to download them all in a single request (and then maybe save it properly in TinyDB) rather than one by one


Sorry about the language. You’re right. I set the blocks—though not the tags—to English.

I correctly configured the “Project path” as you suggested. Then, I performed a get operation for a single question and used got value to transfer that question into a dictionary, displaying it on the screen. There are no other Firebase triggers in the blocks, yet the entire question database was still downloaded to the cache in the background. Is this simply how the Firebase component works? This is problematic because, even if the user solves just one question, the app downloads the entire dataset every time it launches, rapidly exhausting the free monthly Firebase quota. Alternatively, when I request a single question via the Web component using the REST API, there is no issue—it downloads only that specific question—but that approach presents security concerns.

Have you enabled persist?

Whether you’re communicating with Firebase using native blocks or via REST API through the Web component, the only thing that truly secures the database is the rules, have you set them up?

persist is not enabled. What will enabling it achieve?

My application is still in the testing phase. For this reason, the security rules aren’t fully configured yet. I’ll focus on that after resolving the current issue.

From docs:

If true, data will be cached locally and survive app restarts.

But on what basis are you saying that the data is still being fully downloaded?

I checked the real-time download volume in the Firebase console. Even though I performed a getValue operation for just a single question, the download volume reached the size of the entire database (3 MB).

one more thing

Does the persist setting work on the same principle as TinyDB? Will it fetch data locally even after the app is completely closed and reopened (meaning it won’t inflate the Firebase download quota)?

The reason I ask is that I’m about to work on an architecture where I save the questions to TinyDB on a per-trial basis and retrieve them from there. When the screen opens, I’ll check if a trial exists; if it does, I won’t trigger the “get value” block (I’ll only trigger “get value” if there is no trial).

If I remember correctly, every piece of data you receive is saved in a local database, which can also be modified offline, and upon the next reconnection the data modified offline gets updated.

And it might suit your needs, but take my information with a grain of salt because I’ve never actually used it.

https://community.kodular.io/search?q=firebase%20persist

I will test this as well. Thank you for all the information you provided. I wish you all the best.

1 Like