• Stars
    star
    991
  • Rank 46,212 (Top 1.0 %)
  • Language
    Dart
  • License
    Apache License 2.0
  • Created over 5 years ago
  • Updated 3 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Flutter database for super-fast Dart object persistence

ObjectBox

Getting StartedDocumentationExample AppsIssues

Build and test pub.dev package Apache 2.0 license Follow @ObjectBox_io

Flutter database - easy to use & fast Dart object persistence 💙


💙 Jobs: We're looking for a Flutter Developer Relations Manager! 💙


Database for Flutter / Dart - intuitive APIs, simply fast. Persist local Dart objects with ease & speed, focus on the value your application provides.

ObjectBox provides a store with boxes to put objects into:

// Annotate a Dart class to create a box
@Entity()
class Person {
  @Id() 
  int id;
  String name;

  Person({this.id = 0, required this.name});
}

final box = store.box<Person>();

// Put a new object into the box
var person = Person(name: "Joe Green");
final id = box.put(person);

// Get the object back from the box
person = box.get(id)!;

// Update the object
person.name = "Joe Black";
box.put(person);

// Query for objects
final query = box.query(Person_.name.equals("Joe Black"))
        .order(Person_.name).build();
final people = query.find();
query.close();

// Remove the object from the box
box.remove(person.id);

Ready? Continue with the ➡️ Getting Started guide.

Why use ObjectBox

ObjectBox Flutter database is a great option for storing Dart objects locally in your cross-platform apps. It uses minimal CPU, memory and battery / power, which makes it a sustainable choice for mobile and IoT devices. Made for efficient data access, it is 10x faster than any alternative across all CRUD operations. See the performance benchmarks below. No need to learn SQL, as our NoSQL database uses a pure Dart API that is easy to work with and can be integrated in minutes. Plus: We built a data synchronization solution that allows you to choose which objects to sync when and keep data easily and efficiently in sync across devices.

Features

🏁 High performance - superfast response rates enabling real-time applications.
🪂 ACID compliant - Atomic, Consistent, Isolated, Durable.
💻 Multiplatform - Android, iOS, macOS, Linux, Windows, any POSIX-system.
🌱 Scalable - grows with your app, handling millions of objects with ease.
💚 Sustainable - frugal on CPU, Memory and battery / power use, reducing CO2 emmissions.

🔗 Relations - object links / relationships are built-in.
💐 Queries - filter data as needed, even across relations.
🦮 Statically typed - compile time checks & optimizations.
📃 Schema migration - change your model with confidence.

Oh, and there is one more thing...

😮 Data Sync - keeps data in sync offline or online, between devices and servers.

Getting Started

Continue with our ➡️ Getting Started guide. It has resources and video tutorials on how to use ObjectBox in your Flutter or Dart app.

How does ObjectBox compare to other solutions?

  • ObjectBox is fast. Have a look at our benchmarks below, or test it for yourself
  • It's a full NoSQL SQLite alternative with intuitive Dart APIs you'll love 💙
  • It comes with an out-of-the-box Data Sync, making it an effective self-hosted Firebase alternative

Flutter Database Performance Benchmarks

We tested across the four main database operations, CRUD (create, read, update, delete). Each test was run multiple times and executed manually outside of the measured time. Data preparation and evaluation were done outside of the measured time.

Here are the benchmarks for ObjectBox vs sqflite vs Hive 👇

You can run these yourself using our objectbox-dart-performance Flutter benchmark app.

How do you 💙 ObjectBox?

We're looking forward to receiving your comments and requests:

Thank you! 🙏

For general news on ObjectBox, check our blog!

Contributing

Do you want to check out the ObjectBox code itself? E.g. see in action, run tests, or even contribute code? Great! Clone/check out this repository and run this to generate code and get you started quickly:

./tool/init.sh

Also, make sure to have a look at the contribution guidelines - we are looking forward to your contribution.

Packages

This repository holds all ObjectBox Dart/Flutter packages as separate directories:

There's also a separate repository benchmarking objectbox (and other databases) in Flutter: objectbox-dart-performance. And another one testing and comparing the performance of our FlatBuffers fork vs the upstream version: flatbuffers-benchmark.

Other languages/bindings

ObjectBox supports multiple platforms and languages:

  • Java Database (+ Kotlin): runs on Android, desktop, and servers.
  • Swift Database: build fast mobile apps for iOS and macOS.
  • Go Database: great for data-driven tools and embedded server applications.
  • C / C++ Database: native speed with zero copy access to FlatBuffer objects.

License

Copyright 2019-2023 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.0

Unless required by applicable law or agreed to in writing, software
distributed 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 and
limitations under the License.

Note that this license applies to the code in this repository only. See our website on details about all licenses for ObjectBox components.

More Repositories

1

objectbox-java

Android Database - first and fast, lightweight on-device vector database
Java
4,365
star
2

objectbox-go

Embedded Go Database, the fast alternative to SQLite, gorm, etc.
Go
1,082
star
3

objectbox-swift

Swift database - fast, simple and lightweight (iOS, macOS)
Swift
438
star
4

objectbox-examples

Examples for ObjectBox Android/Java, the super-fast database
Java
396
star
5

objectbox-c

C and C++ database for objects and structs
C
176
star
6

objectbox-performance

Performance Benchmarking App for ObjectBox, SQLite(via Room and greenDAO), Realm
Java
130
star
7

objectbox-python

Superfast on-device object & vector database for Python
Python
113
star
8

objectbox-generator

ObjectBox Generator based on FlatBuffers schema files (fbs) for C and C++ (more languages in the future)
Go
35
star
9

objectbox-dart-performance

Flutter App benchmarking the performance of ObjectBox against others (e.g. sqflite, Hive).
Dart
11
star
10

objectbox-azure-sphere

Azure Sphere client connecting to ObjectBox
C
7
star
11

objectbox-go-performance

Open Source Performance Benchmarks for ObjectBox Go, GORM, and others
Go
6
star
12

objectbox-swift-performance

Open Source Performance Benchmarks for ObjectBox Swift
Swift
6
star
13

objectbox-swift-generator

Code generator and model.json builder for the ObjectBox database library. This is currently a quick fork off of Sourcery.
Swift
5
star
14

objectbox-ts-demo

Time Series example project for ObjectBox TS
C++
4
star
15

flatbuffers-benchmark

Testing the FlatBuffers performance of different programming languages
Dart
2
star
16

objectbox-swift-spec-staging

Staging repository for pre-releases. In general, you'd want the official repository at https://github.com/objectbox/objectbox-swift/
Ruby
2
star
17

objectbox-swift-integration-test

Roff
2
star
18

cla

2
star
19

objectbox-java-generator

The ObjectBox Gradle Plugin makes using ObjectBox easy in a JVM or Android project written in Java or Kotlin
Kotlin
2
star
20

.github

1
star
21

objectbox-go-gitbook

1
star
22

objectbox-docs

Official Documentation for ObjectBox, the object and vector database
Shell
1
star