Which database should I use for my flutter app using lots of images? - flutter

I want to build a flutter app which focuses on learning plant names with the help of a lot of pictures. In total there will be 600-800 pictures.
question: Do I store these pictures all in the app or in a database?
From what I read so far I guess the app would be too big if I store all these pictures in the app.
question: Which database should I use for storing such an amount of pictures?
I want to give the possibility to store a lection/course (containing 30-40 pictures) locally on the phone to be able to learn without internet connection.
question: Which database should I use for that?

Question #1: Do I store these pictures all in the app or in a
database?
You should not store all the images in your app. Use the Cloud Storage for Firebase service to store your pictures and download them to your app as desired.
Question #2: Which database should I use for storing such an amount of pictures?
You should use Cloud Storage for Firebase to store your pictures: "Cloud Storage for Firebase is built for app developers who need to store and serve user-generated content, such as photos or videos."
Question #3: I want to give the possibility to store a section/course (containing 30-40 pictures) locally on the phone to be
able to learn without internet connection. Which database should I use
for that?
You can save these pictures locally as explained here in the Firebase doc: "The writeToFile() method downloads a file directly to a local device. Use this if your users want to have access to the file while offline."

If in a database, get pic to many times, and much more than the free limit of database , we will prefer pic in app than in database.
But in app will never consider the cost, just keep the develop account. Maybe, a pic could compress down to 50kb each, and the app will not too big to download.
mongodb google-could amazon ... all database on the market can serve you.
above dbs are good. the more resourses on net, the better envirnment we like.

Related

Flutter: Does Firebase Storage cache my images? [duplicate]

This question already has answers here:
How to store image to cachednetwrok image in flutter
(7 answers)
Closed 16 days ago.
In my Flutter app, I have pages with multiple user profile images. Sometimes 20 of the same user profile image. For every image, I fetch the download URL from Firebase Storage and use a FadeInImage. Will Firebase Storage count every image as a download or do the images get saved to the cache and automatically reused?
In other words, do I need to worry about saving the images to cache myself to reduce downloads and costs or does Firebase do that for me?
do I need to worry about saving the images to cache myself to reduce downloads or does Firebase do that for me?
If you're reading files from Storage, it doesn't mean that they will be automatically cached on your device.
To solve this you have to find a solution for caching, so you don't need to use bandwidth each time you display an image. For Flutter I recommend you check the accepted answer from the following post:
How to store image to cachednetwrok image in flutter
I cannot find any documentation that currently shows any data being cached, but flutter has plenty of libraries that can help with that, I personally use the extended image library https://pub.dev/packages/extended_image that can cache any image fetched on the network with very simple code.
Are you trying to reduce bandwidth costs for Firebase storage or for users so they don't have to download same images every time? If for users, then you'll have to cache them yourselves and write your own logic to purge the files as needed.
Alternatively, consider using Cloud CDN, where egress charges are lower compared to Firebase storage and it would also speed up download speed significantly for end users. It'll also be useful to purge cache programmatically using Cloud Functions/backend when a user updates their profile image.
Also see Firebase storage extremely slow fetching.

It's possible to create an offline app using flutter

I want to develop offline book reading app using flutter. There is any way in flutter so that user can access book offline.
you can put data in form of json and load data when you requires it
you can read more about it here
https://flutter.io/assets-and-images/
You can download the images/pdf files of your book in the device storage (External Storage) by asking user like
"Hey! Do you want this to be available offline? Cool, click the button and grant the storage permission in order to proceed".
After this, you can download the files from the server in device external storage and use it. Simple!

First time developer: Best way to set up my iPhone app in order to store/fetch uploaded user generated data?

I am new to developing iPhone apps, and wanted to be sure that I am laying the correct foundation as I go about the coding process. The app that I am developing will permit users to login, upload photos from their iPhones, write a short description for the picture, as well as view other users photos. Where should I be storing the following data, and how should this be architect-ed? I have heard core data, sqlite, MySQL, PostgreSQL, etc... The data I need to capture and store is:
-Username
-Password
-Photos they upload
-Descriptions of the photos
Ideally, the architecture will support hundreds of thousands of user uploaded images (hypothetically).
I understand that this question is probably incredibly basic on some levels, but again, this is my first time navigating the data storage aspect of an iPhone app.
For Username and Password, look up KeyChain.
For everything else Core Data is good. SQLite is a possibility.

Need iOS Database Cloud Design Tips

I have an app that uses an SQLite database. With the advent of iCloud on the rise I'm trying to figure out a good architecture for syncing data between devices. So lets say my app runs on an iPhone, an iPad, and a Mac. How can I keep data in my DB up-to-date on all devices?
My first thought was, I can put the database in the cloud and send transactions. But the device may not always been online and the users need their content at anytime, so that wont work. My other thought was to continue using the local db, and then when a connection is made, to send the cached data to the central db. The problem is I have no ideal where to even begin on something like that. How would I know which data has been sent and not sent, which data to actually send when a connection is made, etc.
So this is my question (we don't have to get into iCloud specifics), using an SQLite database and iCloud (or any storage medium), how can I sync data between multiple devices, but still have the most recent data stored locally on the device?
You might want to checkout Couchbase Mobile. This would help with the synchronization you are looking for.
If you have a significant investment into CoreData, then you may want to look at writing your own NSIncrementalStore to support writing data to and from a key value store.
iCloud is only going to be a good solution if your data is sandboxed to a specific user. If you have multiple users that want to view the same data then it won't work.

Best practice for sending data updates to iPhone app?

I'm currently in the middle of developing an iPhone app with a big reference database (using Core Data backed with a pre-populated sqlite database). Once the app is live and deployed to a client's iPhone, I need the facility to update/insert a small amount of data. What are best practices / methods for doing this?
There may be occassions when the frequency of updates will be daily for a month or so. Other occassions when a data update happens once every few months.
What is the recommended way of doing this? Note, I don't anticipate any data model changes for these updates -- this is purely an insert/update of data.
At the moment I'm starting to research the use of push data notifications (q:payload size restrictions?), app store updates (q:code/data model only, not data updates?) and the use of my own ad hoc data server (which the app connects to routinely to check for updates).
Can anyone please provide me any pointers on the above?
Thanks in advance
IIRC Push Notifications have a maximum payload of 256 bytes. Enough for notification purposes, but not more. Your app would still have to download the actual data from your own server after receiving the notification.
Note that the app bundle is not writable on the device. So if your app needs to update the data store, you should copy the pre-populated database file from the app bundle to the app's documents directory on first launch.
App Store updates would certainly be feasible (especially now that Apple seems to have gotten its review process down to a few days at most) but note that an App Store update will always replace the entire app bundle (code and data), so if your pre-populated reference database is big, the customer would have to download it in full every time.