Home > Software design >  Flutter SQFlite vs Hive. Which one to use when?
Flutter SQFlite vs Hive. Which one to use when?

Time:12-29

I am developing an app for keeping attendance records for the students and I am confused about using either SQFlite or Hive for the local database. What are the pros and cons of both?

I am currently using Hive and it seems like a hassle when it comes to code readability.

CodePudding user response:

if you want the saved data to be fetched instantly and you won't need complex queries or have relations among the saved entities then go ahead and use Hive since it loads its boxes (saved data) in the memory for instant fetching

otherwise use SQFlite as it's more readable, scalable, and customizable.

in your case and regarding the project you are working on, I believe you should go with SQFlite, maybe in the future you will add some other features not just attendance, and might need to make complex queries.

CodePudding user response:

Both of them work great, but for both proper data modelling is essential.

However, I wonder whether your app can work without storing data externally. In that case, neither is a good option.

  • Related