Introducing the Realm Mobile Platform
If you’ve been following Realm for a while, you probably had an idea that the Realm Mobile Platform was coming. It took some pretty hardcore research getting it to actually work, as it’s a project that has been underway for at least two years.
Realm’s goal has always been to make it possible for people to build better apps: ones that have amazing live and interactive features, that are more easily and quickly buildable, since those kind of apps are currently far too hard to build.
Realm Mobile Database
Realm has quite a long history, and today we’re doing great! We have offices in San Francisco and Copenhagen (some of us have a Danish background). We have around 50 employees now, and we’ve raised money for ourselves. But it didn’t start off like that! It’s funny that it all started with just me and my co-founder, who had this crazy idea while sitting in Denmark that we wanted to build a mobile database.
We applied to Y Combinator. I know there are people who say that if you apply to Y Combinator, you need to know all the right people and fit a certain profile, etc, but we were two people sitting totally alone in Denmark. We didn’t know anybody, and we had no credentials other than our skills and the fact that we’d worked at Nokia doing mobile stuff for a long time. We were total nobodies, and very naive.
Still, we sent our application video, and it was amazing that it was well received! It’s a long story from there, but we tried harder and got everything up and running. We got started and created the mobile database. It was the core engine of what we wanted to do.
Being young, when we started we thought, “How long time can it possibly take?” We both had lots of experience in this field, so we imagined that it would take around half a year before we would have something we could sell. Here we are, several years later, and we actually have a decent product! We launched in 2014, almost three years after starting the company. It takes a long time to build an embedded database, especially if it’s a good one. It’s probably a good thing we didn’t know that when we started, because we may not have started at all. Now that we’re here, it’s really cool!
Now we have this technology in place, developed, fully open source, and it’s pretty awesome. We promised from the beginning that we would open source it, and now you can do whatever you want with it. It’s always a pleasure to give things to the world.
What is most satisfying for me is how much people love it. We get tons of tweets and feedback where people talk about their experience with how cool Realm is. We’re also used pretty much everywhere, which is amazing. We’ve changed so many apps!
The Realm Mobile Platform
After releasing Realm Mobile Database, we needed a next step. It’s great to make a cool database and give it to everybody for free, but that’s not how you create a sustainable company. We needed the Realm Mobile Platform.
One anecdote that most people won’t know is that the original inspiration for Realm came because I was building a text editor at my own company. It was a collaborative text editor with git built in (before git was invented), and I wanted to have real-time collaboration. No database was fast enough to have the type of real-time collaboration I was looking for, so I wanted to make it for myself. I started building that, but the whole idea was to build an ideal database that allows people to share data in real-time. It turns out that it takes a long time, because you actually have to build a database first!
We got a lot of requests for synchronization, and a lot of people wanted to know when it was coming. Today, you want real-time stuff that just works, where you can update and have everything be reactive. It’s currently difficult to make things real-time in your app; you should be able to just connect your UI directly to the data and it should just update. With our platform, you can have these features with hardly any code at all, and it’s easy to do.
You want a reactive setup, where you can just create all your objects, connect them to your UI, and it should work. From my original vision, it should be collaborative. Everybody is getting mobile phones, and we want people to work together. Every app should be collaborative. It should help people to create, so we’re not just sharing cat pictures, but we should have quality apps that actually help people do things. We want everybody to have a seamless experience that just works, online and offline. That was the vision, and it’s what we’ve heard from users.
Realm Mobile Platform is the counterpart to the Database, because you can only do offline for real if you have a real database on the device. That’s key, otherwise it always falls through and the experience is not good. The magic of this is that you can have a database, but the database is just a webpage. Instead of opening the database with a filepath on your disc, you just open it with the URL. You open the shared Realm, and you can open one, ten, or hundreds of them. Anybody who opens the same URL will have the same data, at the same time, in real-time. It’s a very simple concept, but it’s pretty amazing when you actually work with it.
The idea is that the database is offline-first by nature, because it’s real object database. It’s not a SQL database with OM layers, copying data back and forth with inconsistent data. It’s a real database that’s relational, so you can have links to everything. You also have chain notifications that allow you to do reactive things. Now you can totally abstract away the network handling. Instead of thinking about networking, you simply open the Realm at the URL, and it’ll naturally synchronize with whoever else just opened the same Realm.
Other cool things include encryption, which you definitely want today, in both the database and the network. It does a real-time sync, and we actually have event handling, so you can run code on the server and see responsive changes.
Of course, the real magic is in the automatic conflict resolution: the fact that you can adjust the changes. Why automatic conflict resolution instead of manual? The problem is if you do manual conflict resolution, you can never really do real-time, because things just stop. You really want to be able to do it at a real-time speed, so it has to be automatic.
You can actually change the scheme on the fly, you can push data to devices, and with the event frame you can introduce to an existing infrastructure. You have all these devices that all connect to the server. The server has a sync engine that makes all the automatic conflict resolution work. It has an event framework to run code on the server. There’s a dashboard, of course, so you can see what’s happening. There’s authentication, access control, and then you have all the Realms. Every single device can have its own Realm, and they can have Realms that are shared between all of them. You can have as many Realms as you want! That allows you to scale up so you can have millions of Realms, and you’d basically spread out your data around them. We can also connect to other servers, so if you have backend databases or APIs, you can actually make connectors to those. It will integrate into your existing infrastructure.
The key thing that enables this is the idea that everything is just objects all the way down. It’s objects, and the objects are live. If you use Realm already, you have this idea that even if you’re on multiple threads, you can change through multiple threads and you’re still safe, and you’ll see the updates in the other threads. We take that one step further and say that also happens with the network. You can have multiple devices and they all update the objects, but it’s always the same thing: they’re just live objects, they change. The objects are the data model, which really simplifies the mental model. It makes it so much easier to build and maintain apps. The idea is that you can define objects exactly in the same syntax you’d usually do it in.
You create these objects just like regular objects, but suddenly it’s kind of like supercharging them. You get the ability to do transactions and queries on them, you can do persistence, and you get all that for free. It all just works. Plus, it’s still full as a database, and it’s observable. With these features, this is the foundation that allows you to build pretty much anything you want in an app!
The Realm Mobile Platform: it’s available now, so download it! There’s a totally free version for developers: you can run it on your own hardware, and build anything you want with it.
We also have a commercial counterpart (the company has to live!) that solves enterprise needs and has more integration into your backend and more server-side handling, and custom authentication. But the free version is super powerful too! You can build full apps on it with no rate limits. You can use it for anything, as much as you want, for as long as you want.