Intuitive native APIs developers
ObjectBox abstracts the complexity and repetitiveness of decentralized offline-first apps behind enjoyable, easy-to-use, and superfast APIs. Making it easy to implement sustainable resource-efficient architectures, reducing unnecessary cloud waste and enhancing data privacy options.
Our APIs are simple, easy to use, and quick to implement. See for yourself.
From the team behind EventBus & GreenDAO, in the top 1% of Java developers on GitHub.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | @Entity public class Person { @Id long id; String firstName; String lastName; } BoxStore store = MyObjectBox.builder() .name("person-db") .build(); Box<Person> box = store.boxFor(Person.class); Person person = new Person("Joe", "Green"); long id = box.put(person); // Create person = box.get(id); // Read person.setLastName("Black"); box.put(person); // Update box.remove(person); // Delete |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | // person.fbs table Person { id: ulong; first_name: string; last_name: string; } ... OBX_txn* txn = obx_txn_begin(ob); OBX_cursor* cursor = obx_cursor_create(txn, person_entity_id); obx_id id = person_put(cursor, 0, "Joe", "Green"); // Create Person_table_t person = person_get(cursor, id); // Read person_put(cursor, Person_id(person), Person_last_name(person), "Black"); // Update obx_cursor_remove(cursor, id); // Delete |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | // person.fbs table Person { id: ulong; first_name: string; last_name: string; } ... obx::Store store(create_obx_model()); obx::Box<Person> box(store); obx_id id = box.put({.first_name = "Joe", .last_name = "Green"}); // Create auto person = box.get(id); // Read person->last_name = "Black"; box.put(*person); // Update box.delete(id); // Delete |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | @Entity data class Person( @Id var id: Long = 0, var firstName: String? = null, var lastName: String? = null ) val store = MyObjectBox.builder() .androidContext(context) .build() val box = store.boxFor(Person::class) var person = Person(firstName = "Joe", lastName = "Green") val id = box.put() // Create person = box.get(id) // Read person.lastName = "Black" box.put(person) // Update box.remove(person) // Delete |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | //go:generate objectbox-bindings type Person struct { Id uint64 `id` FirstName string LastName string } ...box := BoxForPerson(ob) // Create id, _ := box.Put(&Person{ FirstName: "Joe", LastName: "Green", }) person, _ := box.Get(id) // Read person.LastName = "Black" box.Put(person) // Update box.Remove(person) // Delete |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | class Person: Entity { var id: Id<person> = 0 var firstName: String var lastName: String ... } let store = Store(directoryPath: aPermanentPath) let box = store.box(for: Person.self) let newPerson = Person(firstName: "Joe", lastName: "Green") let id = try! box.put(newPerson) // Create let person = box.get(id) // Read person.lastName = "Black" try! box.put(person) // Update try! box.remove(person) // Delete let query = box.query { return Person.firstName == "Joe" && Person.lastName.startsWith("B") } let persons: [Person] = query.find() |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | @Entity() class Person { @Id() int id = 0; String? firstName; String? lastName; } final store = await openStore(directory: 'person-db'); final box = store.box<Person>(); var person = Person() ..firstName = "Joe" ..lastName = "Green"; final id = box.put(person); // Create person = box.get(id); // Read person.lastName = "Black"; box.put(person); // Update box.remove(person.id); // Delete |
ObjectBox is fast - check it out yourself
Mobile Benchmarks
CRUD Operations | Entities per second (higher is better)
All our benchmarks are Open Source. Check them out on GitHub and let us know what you think. We strive for fair and transparent benchmarks.
ObjectBox Features – giving Mobile & IoT an Edge
Lightspeed
Our motivation to build ObjectBox was to deliver the best possible performance, outperforming every embedded database we’ve ever tested.
Easy Object API
Objectbox is not an ORM, it is build for objects from the ground up, which means no more rows, columns, or SQL. Our concise API is easy to learn and only requires a fraction of the code compared to SQLite.
Querybuilder
With ObjectBox, simply query for objects with checks at compile times; no more typos causing crashes at runtime.
Object Relations
Object references / relationships are build-in, native references.
Reactive
Reacting to data changes is simple and powerful. Use reactive data observers from ObjectBox or integrate with RxJava.
Multiplatform
ObjectBox supports Android, plain-Java, Kotlin (Linux and Windows), POSIX, MacOS, iOS, Go, Python, Dart/Flutter, and C/C++.
Instant Unit Testing
With our multi-platform approach, you can run plain unit tests on the desktop (no Robolectric, on instrumentation tests) with a real database in milliseconds.
Robust Technology
ACID (Atomic, Consistent, Isolated, Durable) properties and Multiversion Concurrency Control (MVCC) provide you with safe transactions and parallelism.
Simple Threading
Objects returned by ObjectBox with in all threads. No strings attached.
No Manual Schema Migrations
ObjectBox takes care of new object versions with added, removed and renamed properties. Automatic schema migration removes that chore for developers.
Daocompact Library
greenDAO is an Object-Relational-Mapper (ORM). If you are already using greenDAO, you can seamlessly switch to ObjectBox using greenDAO compat APIs for ObjectBox. If you are using another ORM or DB, switching to ObjectBox is easy.
Battle Testing
From beta onward, ObjectBox has been running on 30k+ apps, and millions of devices. Of course, we’ve also run over 1,000 individual internal unit tests and empower apps with more than 20 million installs.
Join the community
SIEMENS
“very easy to integrate…gave us the data access speed we needed.”
KONTRON S&T group
“performance improvement far beyond other databases”
Atul Kumar
“ObjectBox made my work easy to store locally. Overall my experience with ObjectBox is mind blowing.”
Manas Thakur
“I liked the fact that it is a synchronous DB and that I don’t have to await for read/write operations.”
Cris @Crispert
“Terrific job, ObjectBox is marvelous solution, it almost makes data persistance invisible. I was really astonished to see how the code shrunk, in front of my eyes when I replaced realm. I’m still amazed how simple all of it is.”
Eslam Mongy
“Thank you. ObjectBox has proven to be an exceptionally efficient solution for local data storage. In my experience, it surpasses the performance of other available options.”
Mohammad Monfared
“I was impressed by the simplicity and efficiency of the ObjectBox database solution.”
Thierry Benda
“ObjectBox is a great candidate to store events and handle them later, amongst many other interesting features.”
ObjectBox Mobile Database Questions Answered
Is ObjectBox DB an ORM (Object-Relational Mapper)?
No, ObjectBox is not an ORM. It’s an offline-first database (as in “data persistency layer” or “data storage”) built from the ground up for fast object persistence on all kinds of devices. This means you don’t have to deal with the rows, columns, and SQL queries of relational databases. Or, in other words: you gain the ease of use of an ORM (easy, native-language APIs) while omitting the performance trade-off of using a SQL DB with an ORM on top.
What platforms does ObjectBox DB support?
ObjectBox Sync runs on a wide variety of devices and operating systems:
- Mobile: Android, iOS
- Desktop and Embedded: Windows, macOS, Linux, and any other POSIX-compliant system
- Automotive: QNX
- Cloud: Any cloud and bare metal
Is ObjectBox free to use? Is it open source?
Yes, ObjectBox DB is completely free to use and all language bindings are open source Apache 2).
What are the minimum hardware requirements to run ObjectBox DB?
32-bit CPU (e.g. ARM-v6, x86), 16 MB RAM, POSIX OS
Is it truly offline-first?
Yes, ObjectBox is fundamentally designed to be offline-first. The database is very lightweight (can be <1MB up to a couple of MB, depending on what features are included), and highly resource-efficient (which is why it is used inside BMW cars). Your application’s data is stored locally on every device using the embedded ObjectBox database, which allows your app to maintain full functionality without an internet / cloud connection. When a connection is available (e.g. a local Wifi, Ethernet, or an internet / cloud connection), you can use ObjectBox Sync, which can automatically and efficiently take care of harmonizing any data changes across devices and / or a central server or cloud. ObjectBox is 100 % cloud-optional. You can use ObjectBox Sync also in a complete offline / on-premise / local setting without using the internet or the cloud.
This offline-first approach ensures that users can continue working with your application regardless of network conditions, and data can be stored where it best fits your use case and preferences.