Realm, regarded by many as one of the best mobile database solutions around, has taken things to an entirely new level with its aptly named Mobile Database product (currently in beta), which helps developers create real-time, collaborative solutions for existing apps.
The concept is straightforward: while many real-time apps rely on some sort of complex cloud-based platform where users perform tasks, Realm uses a server to link devices and actions.
“This launch represents years of work,” said Alexander Stigsen, Realm co-founder and CEO. “We’ve been quietly working on the Realm Object Server alongside all the mobile database work that we are so well-known for. And it’s been really interesting work, solving some of the hard problems around real-time data synchronization, conflict resolution, and event handling.”
After a developer sets up a Realm server, they can start adding code to an app that lets two users work together. This functionality means that users can also work natively and offline, without noticing a difference in performance when they choose to get collaborative.
Changes happen in real-time, too. In Realm’s example, two users of a sketching app work collaboratively at first; one user is disconnected from the Realm server, but continues to work on the image, as does the second user. After the first user is reconnected, his changes start popping up on the other person’s screen as if he were working normally.
That’s because the Realm server saves each line or doodle as a data-point. When the user reconnects, the server knows when his work last synced with that of the other user, and starts plotting the latest data points (lines and such) on the latter’s screen one-by-one rather than dropping everything in all at once.
For users, it’s a win-win scenario. They can work natively, and collaboration isn’t subject to suspect connectivity or a stodgy cloud platform. “It’s very hard to build reliably realtime features into mobile apps today,” Stigsen said. “Yet this is what users increasingly expect of their apps.”
For developers, the upside is potentially massive. Mobile Database lets anyone create real-time collaborative apps, which is great for those who’ve relied on a share sheet to let two users work together, or haven’t even approached the subject because the cumbersome overhead of managing a server environment. After downloading a Realm Object Server and setting up the Realm Browser (which helps you manage data), there’s a sample iOS to-do app named RealmTasks you can tinker with to discover how powerful it can be.
“With Realm, data synchronization is automatic and seamless, you don’t need to write or manage any networking code. You can simply build your app and know that it will always be working with full up-to-objects,” Stigsen said. “Think about what it means if you can just know that the objects on the devices are always fully synchronized with the objects on the server: building things like live collaboration is so much easier. ”
If you’re writing actual data to an app (like a note-taking app), Mobile Database works just like the familiar Realm database solution. As expected, it’s easy to get started with Mobile Database, too — just ten lines of code in the app to manage synchronization.
Mobile Database is currently in beta, which is helping Realm make sure its internal testing will scale. If you’re interested in giving Mobile Database a shot, the company is currently accepting requests to be part of the beta program.