hive_ce
2.24.0, released today by iodesignteam.com
A lightweight and fast NoSQL key-value database written in pure Dart.
WASM-readyRock solid
What it does
Hive CE provides a cross-platform NoSQL database solution built for Dart and Flutter. It allows developers to store data using simple key-value boxes with support for encryption, isolates, and type adapters.
AI-written summary of version 2.22.0, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need a fast, lightweight NoSQL database for key-value storage.
- You need cross-platform support including mobile, desktop, and web.
- You want built-in encryption and simple type adapter generation.
Skip it when
- You require complex relational queries, foreign keys, or a full SQL engine.
- You are using a Dart SDK older than version 3.
Strengths
- Blazing fast performance with no native dependencies.
- Built-in strong encryption support.
- Cross-platform compatibility including mobile, desktop, and browser.
Weaknesses
- Writes can be lost if the process is killed before the future completes and before a manual flush.
- Lacks advanced relational database features like SQL joins.
Setup
- Kind
- Pure Dart
- Effort
- Low
- Code generation
- Yes (build_runner)
- Direct dependencies
- 5
Requires Dart 3. Add the package to dependencies and initialize boxes as needed.
import 'package:hive_ce/hive_ce.dart';
void example() {
final box = Hive.box('myBox');
box.put('name', 'David');
final name = box.get('name');
print('Name: $name');
}Alternatives
Packages that do the same job and could replace hive_ce.
Works with
Packages commonly used together with hive_ce: ones it builds on, ones built on it, and its own family.
- cryptohive_ce depends on itProvides SHA, MD5, and HMAC hashing functions for Dart.
- webhive_ce depends on itLightweight bindings for browser APIs via JS interop
- json_annotationhive_ce depends on itProvides annotations for json_serializable to generate JSON (de)serialization code.
- isolate_channelhive_ce depends on itCommunication channels for isolates based on Flutter's platform channels.
- graphqlBuilt on hive_ceA Dart GraphQL client offering queries, mutations, subscriptions and cache management.
- hive_ce_flutterBuilt on hive_ceFlutter extension for Hive database initialization and path management
- hive_ce_generatorBuilt on hive_ceAutomatically generates TypeAdapters for Hive to store custom classes.
- hydrated_blocBuilt on hive_ceAutomatically persists and restores bloc and cubit states.