Hive for flutter [Tutorial]#1:When, Why. #database

Vivek Yadav
Nov 5 · 2 min read

** Flutter Database **

Q: What is Hive?

Ans: Hive is Lightweight and Blazing fast key-value database written in pure Dart.

Q: How is it different from SQFLite ?

Ans: Sqflite is SQL based local database whereas Hive is a key-value (NoSql) database.

Q. Why should I learn Hive?

Ans: There are lots of reasons to use the hive.

Cross-platform ⚡

  • Runs on desktop, mobile & in browser
  • Very good performance (see benchmark)

Easy to use ❤️

  • Keys are of type String or uint32 and values are arbitrary objects
  • The basic operations are put(key, value), get(key), delete(key)
  • Strong encryption built-in

Lightweight 🎈

  • Small runtime
  • Small disk space consumption
  • NO native dependencies

Find benchmarks here: https://github.com/hivedb/hive

Q. When to use and When not to use?

Ans: 1. When we need to do complex queries then don’t use Hive then go for SqfLite.

2. When we want to store data also we want encryption over our data then use Hive.

3. When we want a single database on all platforms like app, web, and desktop the use Hive.

4. When performance is a very important metric to measure then use Hive.

5. When we are not comfortable with SQL then use Hive.

Note: Search is not provided by Hive now.

We have to implement Search by our own.

For more visit this

We will see the implementation of the Hive in #2 part.

Let me know if you find difficult to understand this. I would love to solve your problems.

Github Link : https://github.com/viveky259259/flutter_for_people/


Connect with me on: Github Twitter LinkedIn


#HappyCoding #flutter #widgets #hive #database

**Subscribe for upcoming posts. Thanks for reading. Let me know what you think about this post.

Vivek Yadav

Written by

Flutter Dev by Heart, Writter ,

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade