In one of the Android app projects at Oursky, we started using Realm for data caching. So users won’t have to look at blank pages when they log back to the app, waiting for remote API results.

We think it’s a minimalistic yet reliable solution, and is worth giving it a shot for your next app. Just beware of the differences between versions, follow the conventions, and pay extra attention when using with other libraries.

More is discussed below in details and with example snippets.

What is Realm?

Realm Database

Realm Database

Realm is the mobile database solution that  proposed as  a replacement for SQLite & Core Data.

It’s like using SQLite with an ORM (as those who used SQLAlchemy may have experience), with a lot of awesome and convenient methods for data transactions.

However, Realm is NOT built on top of SQLite. It persists on its own persistence engine.

Realm is  also cross-platform that supports both iOS and Android, so developers who write Java, Swift, Objective-C can share the same Realm files painlessly.

Continue reading