# ObjectBox — Superfast On-Device Database for Mobile and IoT > ObjectBox is a high-performance embedded database optimized for mobile, IoT, and edge devices. It offers object persistence with minimal CPU and memory usage, plus built-in data sync for offline-first apps. ## Install Save the content below to `.claude/skills/` or append to your `CLAUDE.md`: # ObjectBox — Superfast On-Device Database for Mobile and IoT ## Quick Use ```java // Android/Java example @Entity public class Task { @Id public long id; public String title; } BoxStore store = MyObjectBox.builder().androidContext(context).build(); Box box = store.boxFor(Task.class); box.put(new Task(0, "Buy groceries")); ``` ## Introduction ObjectBox is an embedded NoSQL database designed for on-device storage where speed and resource efficiency matter. It stores objects directly without SQL mapping overhead, achieving read/write speeds significantly faster than SQLite on constrained hardware. Built-in data sync enables offline-first architectures across mobile and edge deployments. ## What ObjectBox Does - Persists objects directly with zero-copy deserialization for minimal latency - Runs on Android, iOS, Linux, Windows, and macOS with tiny footprint - Provides reactive queries that notify observers when data changes - Includes ObjectBox Sync for peer-to-peer and client-server data synchronization - Supports vector search for on-device AI similarity queries ## Architecture Overview ObjectBox uses a custom storage engine built on memory-mapped files with a B+ tree variant optimized for object access patterns. Objects are serialized using FlatBuffers, enabling zero-copy reads directly from mapped pages. The database operates fully ACID with multiversion concurrency control (MVCC), allowing lock-free reads concurrent with writes. Code generation at compile time creates binding classes that eliminate runtime reflection. ## Self-Hosting & Configuration - Add the Gradle plugin (Android) or CocoaPods/SPM (iOS) dependency - Define entities with `@Entity` annotations; the code generator handles the rest - Database files are stored in the app sandbox by default; path is configurable - ObjectBox Sync server can be self-hosted for fleet-wide data synchronization - Configure max database size and read-only mode via BoxStoreBuilder options ## Key Features - Sub-millisecond CRUD operations on resource-constrained devices - ACID transactions with MVCC for safe concurrent access - Cross-platform: same API concepts on Android, iOS, Flutter, Go, Python - Built-in vector search for on-device embeddings and similarity matching - Data Sync works offline and resolves conflicts automatically ## Comparison with Similar Tools - **SQLite/Room** — SQL-based with ORM overhead; ObjectBox is object-native and faster for CRUD - **Realm** — Similar object DB but heavier runtime; ObjectBox has smaller binary size - **Hive (Flutter)** — Lightweight key-value only; ObjectBox supports relations and queries - **WatermelonDB** — React Native lazy-loading DB; ObjectBox offers broader platform support - **LevelDB** — Low-level key-value store without object mapping or sync ## FAQ **Q: Is ObjectBox free for commercial use?** A: The database itself is free under the Apache 2.0 license. ObjectBox Sync is a separate commercial product. **Q: How does it compare to SQLite in speed?** A: Benchmarks show ObjectBox performing CRUD operations significantly faster than SQLite, especially for bulk operations on mobile. **Q: Does it support Flutter?** A: Yes, there is an official ObjectBox package for Dart/Flutter with the same performance characteristics. **Q: What about data encryption?** A: ObjectBox supports database-level encryption to protect data at rest on the device. ## Sources - https://github.com/objectbox/objectbox-java - https://docs.objectbox.io --- Source: https://tokrepo.com/en/workflows/objectbox-superfast-device-database-mobile-iot-a3ed1e5a Author: Script Depot