Skip to content
pubscout

objectbox

5.3.2, released 6 months ago by objectbox.io

Fast on‑device NoSQL object database for Flutter and Dart native apps.

Rock solid
$ flutter pub add objectbox
Source repository

What it does

ObjectBox stores Dart objects directly without tables, offering ACID‑compliant CRUD, queries, relations and vector search. It also provides optional Sync for cross‑device data consistency.

AI-written summary of version 5.3.2, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need high‑performance local persistence with millions of objects
  • You want built‑in relations and query API without writing SQL
  • You plan to use on‑device vector search for AI features

Skip it when

  • You prefer a pure‑Dart solution without native binaries
  • You need a lightweight key‑value store only
  • You cannot add native build steps or code‑generation to your CI

Strengths

  • 10× faster than SQLite in benchmarks
  • ACID compliance and built‑in migrations
  • Cross‑platform native binaries (Android, iOS, macOS, Linux, Windows)
  • Vector search for on‑device AI

Weaknesses

  • Requires native libraries and code‑gen step
  • Larger app size due to native binaries
  • Not pure Dart – limited to supported platforms

Setup

Kind
FFI (native library)
Effort
Medium
Code generation
Yes (build_runner)
Direct dependencies
5

Add objectbox and objectbox_flutter_libs (or sync variant) to pubspec, run build_runner for generated code, install native libs via provided script, and set platform deployment targets (iOS 15+, macOS 11+).

import 'package:objectbox/objectbox.dart';

@Entity()
class Person {
  @Id()
  int id = 0;
  String firstName;
  String lastName;
  Person({required this.firstName, required this.lastName});
}

Future<void> main() async {
  final store = await openStore();
  final box = store.box<Person>();
  final person = Person(firstName: 'Joe', lastName: 'Green');
  final id = box.put(person);
  print('Saved person with id $id');
}

Alternatives

Packages that do the same job and could replace objectbox.

  • sqflite

    Pure SQLite wrapper, pure Dart, no native code‑gen needed

  • hive_ce

    Lightweight pure‑Dart key‑value store, easier setup

  • drift

    SQL‑based with code‑gen, supports complex queries and migrations

Works with

Packages commonly used together with objectbox: ones it builds on, ones built on it, and its own family.