Flutter databases in 2023 – an overview

Flutter databases are databases specifically designed to give Flutter / Dart apps fast data persistence. Other databases can be used depending on the database and use case, but in our experience Flutter databases are easier to use and faster in Flutter/Dart apps. Note: Because “Dart” is such an ambiguous term, “Flutter database” is the established terminology (even though from a tech perspective it is not a great name).

As a Flutter app developer, selecting the right local database is important. After a market overview and terminology, we’ll compare the most popular options (ObjectBox, sqflite, Drift, Floor, Isar, Sembast, Realm) in a matrix.

Continue reading
Objectbox database for Java / Kotlin 3.0

ObjectBox Android database for Java / Kotlin 3.0 + performance benchmarks

ObjectBox – the high performance Android database for Java / Kotlin – goes 3.0 ❤️ and apart from features. the dev team is also sharing CRUD performance benchmarks including MongoDB Realm and SQLite with Room. ObjectBox Database has been used by over 800,000 developers since the 1.0 release for Android and apart from Java / Kotlin for Android, the ObjectBox DB also has C/C++, Go, Flutter/Dart, Swift bindings now and a superfast Data Sync.

What is ObjectBox?

ObjectBox is a NoSQL ACID-compliant object database and an alternative to SQLite and Room. ObjectBox is optimized for fast object persistence on restricted devices, typically “embedded devices”, sometimes called “edge devices” like e.g. smartphones, IoT gateways, PoS systems, or Controlling Units. Because most applications today include any number of decentralized connected devices, ObjectBox also provides fast and easy access to decentralized edge data through an out-of-the-box Data Sync solution (Early Access).

Continue reading

Flutter Databases Compared

What is the best Flutter Database?

Flutter Database options are still limited. We compare the available alternatives, and share performance benchmarks. 

How to persist data in Flutter / Dart?

The database market is a long-established saturated market and still experiencing double-digit growth. Most of that growth stems from NoSQL databases and newer database technologies, like time-series databases or graph databases. As Computing is shifting towards Decentralized Computing on the Edge, local databases that support decentralized data flows on Mobile, IoT, and other Embedded Devices come into focus. Some come from the Flutter data persistence world, and we will take a look at them in a second.

databases-time-history

Before we dive into the Flutter database options and compare them, we’re quickly carifying the term to make sure we share a common ground. Don’t worry, we’ll not get theoretical, but simply make sure we share a common language.

Continue reading

Mobile databases: SQLite and SQLite alternatives for Android and iOS

UPDATED 2023 A long time ago at Droidcon Berlin, we noticed a lot of questions around databases. Many people weren’t aware of SQLite alternatives and the differentiation between databases and Object-Relational Mappers (ORMs). Therefore, we followed up with an overview of the local database landscape (Edge Databases), which we maintain ever since. We just updated the comparison table in June 2023.

Why use a local database on mobile?

There are some advantages associated with using a local database (Edge Database):

  • Always works: full offline modus for apps that depend on stored data
  • Manageable costs: Frugal on bandwidth for apps that depend on stored data
  • Speed: fast and predictable performance independent from network availability
  • Data Privacy: personal data can be stored with the user, where some say they belong)

Continue reading

ObjectBox is a Techstars’17 company

We just joined Techstars London with our Mobile Database ObjectBox. We’re really happy to be part of Techstars and to have the opportunity to learn so much. If you’re interested in learning more about that, we will post regular updates on our Techstars’ journey on our ObjectBox Blog. We already posted on our first days at Techstars and how we got into Techstars. Thanks to everyone who helped us on our journey so far, but especially our developer community on github. We could never have done any of our projects without you and we appreciate your feedback and support a lot! Please feel free to ping us with any questions you may have.

ORM FAQ

SQLite access with an ORM – FAQ

What is an Object-Relational-Mapper (ORM)?

An ORM is a layer between the relational SQLite database and the object-oriented app code. The ORM allows the developer to use the database without the need to transform objects into a format suited for the relational database.

Do I need an ORM to work with SQLite?

Continue reading

keep your data safe with SQLCipher

Database Encryption for Android N: SQLCipher 3.5

SQLCipher 3.5.0 with support for Android N was released yesterday. Previous versions of SQLCipher linked to non-public Android libraries, a practice Google warned about earlier. Android N is getting stricter about linking to platform libraries. To comply with Android N, the SQLCipher authors did the necessary changes and also did a major code clean up. This results in a massive code reduction, as you can see in the following table:

SQLCipher 3.4

SQLCipher 3.5

AAR size

7.15 MB

2.87 MB

armeabi-v7a .so size

2.50 MB

1.43 MB

ICU size compressed / uncompressed

2.19 MB / 6.73 MB

-

That's really good news. Just by using the new version 3.5.0 of SQLCipher, you can reduce your APK size (and build/deployment time). Not just the binary .so files got smaller, also the big "icudt46l.dat" file was removed in 3.5.0.

To see the effect in an app, we took the greenDAO example app and compared the resulting sizes. Of course, the version using built-in SQLite is by far the smallest, but your APK may lose 4.4 MB if you were using a previous version of SQLCipher:

SQLite

SQLCipher 3.4

SQLCipher 3.5

greenDAO Example APK size

70 KB

7.22 MB

2.80 MB

greenDAO Example size on device (Nexus 5x)

0,88 MB

17,89 MB

12.39 MB

We noticed one incompatibility with SQLCipher 3.5.x however. Android's SQLiteDatabase defines two additional collations:

In addition to SQLite's default BINARY collator, Android supplies two more, LOCALIZED, which changes with the system's current locale, and UNICODE, which is the Unicode Collation Algorithm and not tailored to the current locale.

Running SQL ORDER commands with "COLLATE LOCALIZED" does not work anymore starting with SQLCipher 3.5.0. That is the downside of the ICU (and ASOP code) removal.

So, what about greenDAO support for SQLCipher 3.5.x? greenDAO used "COLLATE LOCALIZED" in the QueryBuilder when specifying orders using string properties. To ensure compatibility with SQLCipher 3.5, we just released greendao-encryption V2.2.2 without the LOCALIZED collation.