- Notifications
You must be signed in to change notification settings - Fork309
Database for Android and JVM - first and fast, lightweight on-device vector database
License
objectbox/objectbox-java
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Getting Started •Documentation •Example Apps •Issues
ObjectBox Java is a lightweight yet powerful on-device database & vector database designed specifically forJava and Kotlin applications.Store and manage data effortlessly in your Android or JVM Linux, macOS or Windows app with ObjectBox.Easily manage vector data alongside your objects and perform superfast on-device vector search to empower your apps with RAG AI, generative AI, and similarity search.Enjoy exceptional speed, battery-friendly resource usage, and environmentally-friendly development. 💚
ObjectBox provides a store with boxes to put objects into:
// Annotate a class to create a Box@EntitypublicclassPerson {private@Idlongid;privateStringfirstName;privateStringlastName;// Constructor, getters and setters left out for simplicity}BoxStorestore =MyObjectBox.builder() .name("person-db") .build();Box<Person>box =store.boxFor(Person.class);Personperson =newPerson("Joe","Green");longid =box.put(person);// Createperson =box.get(id);// Readperson.setLastName("Black");box.put(person);// Updatebox.remove(person);// Delete
// Annotate a class to create a Box@Entitydata classPerson( @Idvarid:Long =0,varfirstName:String? =null,varlastName: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()// Createperson= box.get(id)// Readperson.lastName="Black"box.put(person)// Updatebox.remove(person)// Delete
Continue with the ➡️Getting Started guide.
- Key Features
- Getting started
- Why use ObjectBox?
- Community and Support
- Changelog
- Other languages/bindings
- License
🧠First on-device vector database: easily manage vector data and perform fast vector search🏁High performance: exceptional speed, outperforming alternatives like SQLite and Realm in all CRUD operations.
💚Efficient Resource Usage: minimal CPU, power and memory consumption for maximum flexibility and sustainability.
🔗Built-in Object Relations: built-in support for object relations, allowing you to easily establish and manage relationships between objects.
👌Ease of use: concise API that eliminates the need for complex SQL queries, saving you time and effort during development.
For Gradle projects, add the ObjectBox Gradle plugin to your root Gradle script:
// build.gradle.ktsbuildscript {val objectboxVersion by extra("4.3.0") repositories { mavenCentral() } dependencies { classpath("io.objectbox:objectbox-gradle-plugin:$objectboxVersion") }}
Using plugins syntax
// build.gradle.ktsplugins { id("com.android.application") version"8.0.2" applyfalse// When used in an Android project id("io.objectbox") version"4.3.0" applyfalse}
// settings.gradle.ktspluginManagement { resolutionStrategy { eachPlugin {if (requested.id.id=="io.objectbox") { useModule("io.objectbox:objectbox-gradle-plugin:${requested.version}") } } }}
Using Groovy syntax
// build.gradlebuildscript { ext.objectboxVersion="4.3.0" repositories { mavenCentral() } dependencies { classpath("io.objectbox:objectbox-gradle-plugin:$objectboxVersion") }}
And in the Gradle script of your subproject apply the plugin:
// app/build.gradle.ktsplugins { id("com.android.application")// When used in an Android project kotlin("android")// When used in an Android project kotlin("kapt") id("io.objectbox")// Add after other plugins}
Then sync the Gradle project with your IDE.
Your project can now use ObjectBox, continue bydefining entity classes.
This is currently only supported for JVM projects.
To set up a Maven project, see theREADME of the Java Maven example project.
ObjectBox is a NoSQL Java database designed for local data storage on resource-restricted devices, prioritizingoffline-first functionality. It is a smart and sustainable choice for local data persistence in Java and Kotlinapplications. It offers efficiency, ease of use, and flexibility.
Optimized for speed and minimal resource consumption, ObjectBox is an ideal solution for mobile devices. It hasexcellent performance, while also minimizing CPU, RAM, and power usage. ObjectBox outperforms SQLite and Realm acrossall CRUD (Create, Read, Update, Delete) operations. Check out ourPerformance Benchmarking App repository.
With its concise language-native API, ObjectBox simplifies development by requiring less code compared to SQLite. Itoperates on plain objects (POJOs) with built-in relations, eliminating the need to manage rows and columns. Thisapproach is efficient for handling large data volumes and allows for easy model modifications.
💐Queries: filter data as needed, even across relations
💻Multiplatform: supports Android and JVM on Linux (also on ARM), Windows and macOS
🌱Scalable: handling millions of objects resource-efficiently with ease
🦮Statically typed: compile time checks & optimizations
📃Automatic schema migrations: no update scripts needed
And much more than just data persistence
🔄ObjectBox Sync: keeps data in sync between devices and servers
🕒ObjectBox TS: time series extension for time based data
❤Tell us what you think! Share your thoughts through ourAnonymous Feedback Form.
At ObjectBox, we are dedicated to bringing joy and delight to app developers by providing intuitive and fun-to-code-withAPIs. We genuinely want to hear from you: What do you love about ObjectBox? What could be improved? Where do you facechallenges in everyday app development?
We eagerly await your comments and requests, so please feel free to reach out to us:
- AddGitHub issues
- Upvote important issues 👍
- Drop us a line via contact[at]objectbox.io
- ⭐ us on GitHub if you like what you see!
Thank you! Stay updated with ourblog.
For notable and important changes in new releases, read thechangelog.
ObjectBox supports multiple platforms and languages.Besides JVM based languages like Java and Kotlin, ObjectBox also offers:
- C and C++ SDK: native speed with zero copy access to FlatBuffer objects
- Dart and Flutter SDK: cross-platform for mobile and desktop apps
- Go SDK: great for data-driven tools and embedded server applications
- Swift SDK: build fast mobile apps for iOS (and macOS)
Copyright 2017-2025 ObjectBox Ltd. All rights reserved.Licensed under the Apache License, Version 2.0 (the "License");you may not use this file except in compliance with the License.You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0Unless required by applicable law or agreed to in writing, softwaredistributed under the License is distributed on an "AS IS" BASIS,WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.See the License for the specific language governing permissions andlimitations under the License.
Note that this license applies to the code in this repository only.See our website on details about alllicenses for ObjectBox components.
About
Database for Android and JVM - first and fast, lightweight on-device vector database
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.