Skip to content

Latest commit

 

History

History
29 lines (18 loc) · 1.16 KB

when_to_use_hive.md

File metadata and controls

29 lines (18 loc) · 1.16 KB

When to use Hive

When to use Hive

Hive is very performant because it has little overhead compared to relational databases. The API is very close to how the data is stored on the disk.

Key-value databases can be used to store almost any kind of data. For example:

  • User profiles
  • Session information
  • Article/blog comments
  • Messages
  • Shopping cart contents
  • Product categories
  • Binary data
  • etc.

Hive is also one of the best options when it comes to cross-platform support. You don't have to include binaries, and it works in the browser using IndexedDB.

If you use the shared_preferences packages and don't need to access them from native code, you should always use Hive instead.

When not to use Hive

Every kind of data can be stored in Hive when modeled correctly. That being said, it might sometimes be more convenient to use a relational database like SQLite. (More convenient, not faster!)

Especially if your data has complex relations and you rely heavily on indices and complex queries, you should consider using SQLite.

Since Hive is so lightweight and will hardly increase your app size at all, you can also use Hive and other solutions together.