Build offline-first apps faster – on Mobile, IoT & Embedded Devices
ObjectBox is a superfast Mobile Database / Edge Database persisting data locally on restricted devices, e.g. mobile phones, cars, machines, or any kind of IoT device. Because edge applications typically entail exchanging data of many distributed devices, ObjectBox Database comes with an out-of-the-box Data Sync. It takes care of synchronizing data between devices and of course works cross-platform (check out this simple tutorial to see how easy you can sync data across platforms with ObjectBox Sync).
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 | @Entity public class Person { @Id long id; String firstName; ... } // MyObjectBox is generated by ObjectBox BoxStore boxStore = MyObjectBox.builder() .androidContext(YourApp.this).build(); Box<Person> box = boxStore.boxFor(Person.class); Person person = new Person("Joe", "Green"); long id = box.put(person); // Create Person 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_first_name(person), "Black"); // Update obx_cursor_remove(cursor, id); // Delete |
1 2 3 4 5 6 7 8 | @Entity data class Person( @Id var id: Long = 0, var firstName: String, var lastName: String ) val box = boxStore.boxFor<Person>() box.put(Person(0, "Joe", "Green")) |
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 23 | 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() </person> |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | @Entity() class Person { int id; String firstName; String lastName; } // Note: in Flutter you also need to specify a directory, see examples. final store = Store(getObjectBoxModel()); 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</person> |
Want to sync data seamlessly? Check out ObjectBox Data Sync
See how cross platform sync works
This tutorial + video shows how you can sync between three instances of our multiplatform task-list example app. It will walk you through all the necessary steps to implement sync in your Java (Android), C++ and Go apps.
Stay in touch
Star on GitHub
Share on Twitter
Ask a Question
ObjectBox is the fastest kid on the block. Check out our benchmarks.
Mobile Benchmarks
CRUD Operations | Entities per second
All our benchmarks are Open Source. Check it out on GitHub and let us know what you think. We strive for fair and transparent benchmarks.
Developers Love Working with ObjectBox
“Thanks for such a powerful database solution, I can’t imagine my life without ObjectBox now
Vas
MathTrainer – build with ObjectBox
Terrific job, ObjectBox is marvelous solution, it almost makes data persistence invisible. I was really astonished to see how the code shrunk before my eyes when I replaced realm. I am still amazed how simple all of it is.
Cris
Keep up the amazing work! As I found eventbus some time ago I was like: HOLY these guys know where the “problem” is and try to find a brilliant solution to it without making things complicated. Anyone can clearly see that this approach is reflected in ObjectBox.
Pack
ObjectBox Features – the fast database for the Edge in Mobile and IoT
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 build for Mobile and IoT from scratch. Object-oriented, no more rows, columns, or SQL. Easy to learn API that 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 C / C++, Android, plain-Java, Kotlin (Linux and Windows), POSIX, MacOS, Swift (iOS), Go, Python and Flutter / Dart.
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.
SCHEMA MIGRATIONS
ObjectBox takes care of new object versions with added, removed and renamed properties.
DAOCOMPAT LIBRARY
Already using greenDAO? Switch seamlessly to ObjectBox using greenDAO compat APIs for ObjectBox.
SYNC
Synchronize your online / offline data seamlessly with simple APIs. Find out more about sync.