The Realm Mobile Platform

The core concept of the Realm Mobile Platform is a lightweight object container called a Realm. Like a database, data in Realms can be queried and filtered, interconnected, and persisted. Unlike a traditional database, though, objects in Realms are live and fully reactive. Realms synchronize seamlessly between devices and applications, and can be accessed safely across threads.

The Realm Mobile Database

The Realm Mobile Database is built from the ground up to run on mobile devices. Unlike a traditional database, objects in a Realm are native objects. You don’t have to copy objects out of the database, modify them, and save them back—you’re always working with the “live,” real object. If one thread or process modifies an object, other threads and processes can be immediately notified. Objects always stay in sync.

The Realm Mobile Database is open source (using the Apache license) and cross-platform, with libraries available for Android, iOS, Xamarin (.NET), and React Native. Realms are fully interchangeable between platforms.

You can use the Realm Mobile Database all on its own. But to take full advantage of the Mobile Platform, pair it with the Realm Object Server.

The Realm Object Server

Applications built on the Realm Mobile Platform have the ability to access and create Realms on the Realm Object Server. All your application needs is the connection information for your Object Server and the URLs of the server-side Realms. Objects on the Realm Object Server will be downloaded as the application needs them–then the local copy of the Realm will be kept fully synchronized with the Object Server’s copy.

Realms always operate in an “offline first” fashion: reads and writes take place on the local copy of the Realm. Syncing is automatic and fully transactional, and takes place as soon as a data connection is available.

Realms in Practice

Realms are defined with schema, like tables in a conventional database, but they’re more powerful than tables–a Realm can contain multiple kinds of objects, each with their own enforced schema. Yet unlike a database, a Realm is lightweight. An application can use multiple Realms, both local and remote, with different permissions for different users.

Imagine a hypothetical storefront application. The catalog could be a read-only remote Realm, accessed by all devices running the application. The shopping cart might also be a remote Realm, accessible only by devices on the same user account, so a user could start shopping on their phone and check out on their tablet. There could be a wish list Realm that users can share with one another. And every device might have a local Realm to store information that doesn’t need to be synchronized. All the remote Realms are synchronized through the Realm Object Server, with local copies stored on the devices for transparent offline capability.

Getting Started

The Realm Object Server is available for RedHat/CentOS and Ubuntu Linux, as well as on Amazon EC2. In addition, you can install a macOS Object Server “bundle” that comes with RealmTasks, a pre-built demo application. While you’ll likely want to use self-hosted Linux or a cloud deployment in production, the macOS bundle is a great way to quickly learn about what the Realm Mobile Platform can do.

The Realm Mobile Database is available for Android (Java), iOS (Objective-C and Swift), Xamarin, React Native, and Node.js. Note: The Realm Mobile Database JavaScript library will not work in a web browser.

Note: If you download the macOS bundle above, it comes with the Swift and Objective-C Realm Mobile Database bindings.

Professional and Enterprise Editions: These editions of the Realm Mobile Platform provide a Node.js-based API to access and change Realms with server-side code, making it easy to integrate existing back end systems and web applications. In addition, they offer event handling capability (through the Node.js API), high availability and load balancing features, and full phone and email support from Realm engineers. Learn more about them and start a free trial.