I am using hive for flutter application,
Is it safe, is it scalable, good to continue with hive or should I use sqlite or any other database for flutter application.
here are some features of hive :
Hive is a lightweight and blazing fast key-value database written in pure Dart.
have 120 points that is full a package can have.
As per flutter official policy no any package can be deleted once its uploaded on pud.dev.
Strongly encrypted using AES-256.
so you should definetly go for hive. if you don't have experience in native.
Related
I'm using this package Hive
In my code, I load json from firebase storage and store in Hive box at the beginning, and my web has very slow inital loading (4-5 seconds).
Does it come from Hive or not? Hive is integrate everywhere in my project, so removing it for test is not a good idea.
I am about to start a flutter project and coming from android kotlin I was looking for the closest database to room.
I have read about floor and hive.
Before spending hours using both to figure out which one to stick to, I was wondering what you suggest guys.
I don't want to use firebase since the data remain mainly on tve user's device.
If you are happy with room and Kotlin I'd say Floor is your best bet for Flutter. While I haven't used either, I have used other object mappers with SQLite as well as Hive.
Now Hive as non-SQL database is totally different from an SQL based database.
I was working on a project to create a flutter to-do app to store data locally on mobile devices but I am not sure how to save data on local storage or something similar on the web.
So, I want to save the data locally if it is a mobile device and save the data on local storage if it's accessed via the web.
I don't know where to start, please advise.
Options
You can use shared_preferences as it uses shared_preferences_android, shared_preferences_ios and shared_preferences_web (using IndexedDB) for the different platforms, note that this is not relevant for you directly as shared_preferences switches accordingly to the required platform.
Alternatively you can also use hive, as it also supports the web (via IndexedDB) and of course all other Platforms similar to shared_preferences.
The last option that also supports web is isar, it is however the most advanced of the three and is not well suited for this simple application at all.
Docs
All links link to their respective pub pages with enough docs. The only problem now is when to use which of the package.
Which to use
The flutter community is pretty divided over this, but as you can see shared_preferences has more likes and is from the flutter team at google themselves. However shared_preferences is very basic and if you are considering to save your own class objects (which is probably of use in an todo app) hive has a steeper learning curve to do so, but imo its better than just serialising it with and from json.
Of course json is completely fine, more so as you are probably a beginner, but for more complex applications hive (and if it gets really complex isar) is much better imo.
currently, I am using firebase for the backend but is there any path I have to learn to do backend without using firebase since it's limited free
Yes you can create backend with nodejs and connect nodejs with your flutter app. There are plenty of resources for learning how to connect nodejs backend with flutter app
Yes. You can use Python, node js, PHP-laravel.. It depends on the projects. According to the project, you can choose the backend.
"backend in flutter" ? , Flutter is framework in which we use dart programming language so the question is wrong. But perhaps you want to ask something else, which I was also exploring during my initial years.
For realtime database you can use mongo with polling (with or without even any server since you can even poll and crud in database with flutter itself).
For firebase cloud functions you either make your own APIs (with any backend say nodejs , Django , php..) and call them with Cron jobs or use mongo trigger.
For app performance monitoring , you first need to take data from your app itself and then store it in database and then need to make a web panel for showing that data in interactive manner.
Firebase hosting can't be your case so skipping it.
I hope that clears your doubt.
try supabase or rethinkdb + rust
I'm a beginner programmer on the dart and flutter. I want to create an app to manage my small shop and save data on a physical device. I searched for any code samples, but I couldn't find anything. Any ideas or suggestions from Flutter professionals to begin my project will be really helpful.
You can either use sharedPrefernce plugin for storing data. But data may be persisted to disk asynchronously, and there is no guarantee that writes will be persisted to disk after returning, so this plugin must not be used for storing critical data.
Another option is Hive fast key-value database written in pure Dart.
you can also explore other options like sqllite or firebase_database
flutter create appname - This can be used to create flutter app