Introducing the Realm Mobile Platform: Realtime Sync Plus Fully Open Source Database
This post announced the launch of Realm Mobile Platform in Sept. 2016. Please keep in mind that some pieces may be out of date, so check out the latest here.
When we launched Realm in 2014, our goal was to help mobile developers build better apps faster by giving them a powerful alternative to SQLite and Core Data. Two and a half years later, we’ve reached more than a hundred thousand active developers and more than a billion worldwide installs of apps that use Realm. We’re extremely grateful to the developer community for the adoption, support, and feedback that has gotten us to where we are today — but we have much more to do.
Today, we’re launching the Realm Mobile Platform, a new offering that integrates our fully open-source (see below!) client-side database for iOS and Android with new server-side technology providing realtime synchronization, conflict resolution, and reactive event handling. The new platform makes it easy for mobile developers to create apps with difficult-to-build features like realtime collaboration, messaging, offline-first experiences, and more.
The new platform is available as a beta today, in two versions (read about our third, Pro Edition, launched in December 2016). The Developer Edition is free forever for all kinds of use cases, from hobbyists to small commercial applications, and the Enterprise Edition is available as a time-limited trial and fully supported product designed for the largest production use cases. The full details are covered below. Today the platform supports Java, Objective-C, and Swift, but React Native and Xamarin support are not far behind.
We’re also making another big change: We’re proud to be open-sourcing Realm Core, making the Realm Mobile Database fully open-source as of today — you can find the repos here. The Mobile Database is critically important to us, both as a component to the new platform and as a standalone database option for mobile developers, and we’ll continue to have engineering teams dedicated to maintaining and improving Realm Java, Realm Objective-C, Realm React Native, Realm Swift, and Realm Xamarin.
Objects All the Way Down
Even long-time Realm users may not realize that we’re an embedded object database at the core level, but it is one of our key differentiators. The ease and speed of use that developers love about Realm is a direct result of this. There is no complicated object relational mapping to wrestle with, there are only objects — so your database is your data model.
We have extended that aspect of our design philosophy to the new Object Server, and an important part of the magic behind our platform is something we call “live objects.” Live objects mean that the data objects on the device are always kept fully synchronized with the data objects on the server. Synchronization happens automatically and seamlessly — there’s no networking code to write — and is very efficient because only the changes are transmitted, not entire objects. The Realm platform also handles conflict resolution, so competing changes to shared live objects are resolved deterministically. It does this automatically by default with preset rules, and this mode will handle most use cases, but you can also easily create custom conflict resolution rules.
With Realm, you never need to think about networking. You can simply build your app with the confidence that it is working with live objects. That means all kinds of otherwise difficult-to-build features, like realtime collaboration or messaging, are a lot easier. Think, for example, about allowing users on different devices to collaborate on a shared whiteboard. The hardest parts of making that work are ensuring that changes are reflected in each user’s UI immediately, and that any conflicts — users drawing or erasing similar parts of the drawing simultaneously — are handled elegantly. The Realm platform gives you both out of the box.
Building Offline-first Experiences
The Realm platform is also a great solution for offline-first apps, where delivering a seamless user experience despite lost or intermittent connectivity is a priority. Using the Realm Mobile Database by itself gives you a very efficient, embedded database on the device, so even if the connection is dropped, your app will maintain a good user experience. It’s always been an important benefit of using the Realm Mobile Database.
But when you use the whole Realm platform — Realm Database plus the Object Server — you get much more. Automatic two-way sync just happens in the background, you can be certain that the data objects on the device are fully up-to-date as of the moment before the connection was lost. When the connection is restored, sync happens automatically again, and any conflicts that may have occurred are automatically resolved — the live objects are again fully up to date. Your users can just keep on working as if nothing happened.
The professional and enterprise versions of the Realm platform include another key feature: a server-side event handling framework that provides the plumbing required to easily trigger server-side logic whenever an object changes. You can configure this framework to listen for object changes from the device side and to then instantly run server code in response. Perhaps a user enters a coupon code while filling out an order form. This is captured locally as a change to the device-side coupon object, which syncs to the server instantly. That specific change causes the event handling framework to trigger a check of the coupon code against valid codes, updating the server-side coupon object with a response about the validity. This response is then synced back down to the device-side coupon object triggering a notification that updates the UI.
You can use event handling to build integrations to existing APIs and infrastructure, allowing the Realm Object Server to serve as an API bridge or mobilization middleware. It also enables you to design your app around “serverless” computing principles — you can write discrete functions for each specific trigger.
Get Started Today
The Realm Mobile Platform is available in three versions (as of December 2016). You can download the free Developer Edition, start a free trial of Professional Edition, which includes event handling, or request a demo of Enterprise Edition. Compare features and editions here.