Which database should I use for my Flutter application?
Asked Answered
H

2

6

I am making an application in Flutter, which requires to save the daily data that the users input in the application. The user has 10 daily actions to do.

The app needs to:

  • Save the daily data that the user inputs in those 10 actions.
  • Make a daily, weekly, monthly, quarterly and yearly summary of the data, divided by each action.

At the start of the development of the app I was thinking of using Firebase, but I feel like it is not the best option.

Hogtie answered 18/3, 2022 at 16:15 Comment(0)
S
20

If your app only needs to support offline data saving mechanism which not required any internet connectivity then you would use:

  • Isar (It is a no-sql/non-relational local/offline database which has interactive inspector editor)
  • Object Box (It is a no-sql/non-relational local/offline database)
  • Hive (It is a no-sql/non-relational local/offline database)
  • Sqflite (It is a sql/relational local/offline database)
  • Drift (It is a sql/relational local/offline database which is build on top of sqlite)
  • Realm (It is a no-sql/non-relational local/offline database build on top of mongodb)

Otherwise you can use:

  • Firebase (It is a no-sql/non-relational online backend as a service)
  • AWS Amplify (It is a cloud based backend as a service)
  • Parse Server (It is a kind of sql/relational online backend as a service)
  • AppWrite (It is a no-sql/non-relational online backend as a service)
  • Supabase (It is an online backend as a service)

If you want to write dart based custom backend:

  • Dart Frog (It is a minimalistic backend framework)
  • Serverpod (It is a sql based backend framework)

If you came from Java/Native Android or React Native background:

  • Spring Boot (It is a Java (Kotlin) based enterprise level backend framework)
  • Nest JS (It is a progressive Node JS based reliable backend framework)

According to your provided information, I think Firebase or AWS Amplify (for online backend as a service) and Isar (for local db and for flutter web support use Sqflite or Drift instead of Isar) would be good option.

Sherronsherry answered 18/3, 2022 at 16:53 Comment(12)
Hive is deprecatedReflexive
You can use object box no sql storage. It is very fast for query.Sherronsherry
Yes now I am using Object BoxReflexive
Yes, avoid Hive! It will delete your data unexpectedly. Loads of open issues on github. I did not realise hive was deprecated because it still has 100% popularity on pub.dev.Propositus
I went with Isar and regretted it. I'm going with drift because it uses SQLite under the hood which is tried and tested. A little more work to set up but Isar and Hive are a bit of a mess, with no web support even though it says it does.Estivate
Oh, actually I never used isar or hive for flutter web.Sherronsherry
@KunalKalwar.. Hive is not deprecatedPamphylia
@Pamphylia I see its updatedReflexive
what's good for web as well as mobile?Adumbrate
@Adumbrate it depends on your project and context.Sherronsherry
Just for your info (maybe you can edit the response, Realm will become an only local database, the Atlas part will be ended in september 2025...Tinstone
Thanks @Pred05, I have updated the answer.Sherronsherry
U
0

Now a days firebase is recommended for fast and realtime database. The description you provide for your app it can manage through firebase. You can store data effecitnly in collections and subCollection. I think the important thing is to store how effecitnly you store data in your data base to save repeating of feilds and much more. And if you want to use local data base hive is recomended for this. Hive is fast non-sql data base. I hope so this will give you some overview.

Unscreened answered 23/9 at 7:57 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.