I have integrated Firebase (Firestore and Storage) inside my app (it is about QRs and chat with images). I have been checking the costs of the data transmission with Firebase and I think bill could skyrocket if my app is really successful.
I have been wondering lately about the posibility of storing in user's device the information that has been already downloaded from Firebase (chat messages, images, etc). Only not downloaded data will be requested to Firebase.
My idea is having the same data structure and content in both repositories, Firebase and local. Once the info has been requested to Firebase, replicate it locally and provide local information to the app. Historic information is never modified.
Has anybody handled two data repositories? Pros, cons?
I am working with Flutter.
Thank you.