I created Flutter app as using Supabase as Database.
But it consumed 24.24 GB
in about 20 days, even Instagram consumes 1.76 GB.
Many users experienced that their phones becomes slower and my app is killed.
When I see my app’s data consumption, It takes high data from 2 points.
1)
My app fetches data from table diaries
with range 5 and as user scrolls down, it fetches 5 items of diaries data more.
When I just scrolls about 3 times, it consumes 32 MB
.
I think that It is common practice of normal apps.
32 MB is common data consumption for this action?
This fetching is done in initState()
of screen, which means whenever user opens this screen, fetching is executed.
Should I convert this action to subscribe changes of data?
But I think most of this action is done as my process, not subscription of data.
2)
My app fetches all necessary columns from table users, diaries, comments, likes, and steps in certain period.
And as combining these data, I returns total points of all users.
This takes too much data for sure, about 40 MB
.
These actions are too large, so I can’t show my codes here.
But Please give me some advice.
I think many apps also have this kind of complexed query and fetching.
How to reduce data consumption..?
Display the least possible information, that’s it 🙂 If this is a diary application, just display the titles for each when the user scrolls.
32 MB is common data consumption for this action?
No, it is not. Just by scrolling 5 entries, it MUST NOT exceed even 100kb. You mentioned you retrieve everything, even comments. This might pump up the numbers, depending how they are stored. If – for example – you do not store it as plaintext, and users can embed images/videos then that explains why this happens.
I suggest not to retrieve all these information, but an extract. E.g. only the number of reactions/likes, number of comments only. And when they click on a button, then the rest is shown.
As I do not know your data structure, that’s all I can say.
1