Realm Blog

Keeping your edge as a mobile developer: Announcing Realm Academy

by /

At Realm, we consistently hear that one of the biggest challenges facing today’s developers is around keeping their edge. With the constant emergence and evolution of new languages and frameworks, best practices, technologies, and architectures, how can a busy professional dev keep up? The traditional methods for professional learning and inspiration—conferences, local meetups, and finding content across the web and social media—are great, but just aren’t enough. Despite requiring a big investment in time, money, and legwork, they still fall short at providing the depth and breadth of content pro devs really need.

Today, to help solve this problem, we’re launching Realm Academy, a new resource that brings together more than 850 pieces of unique developer content from the very best experts in mobile. These are highly practical videos, articles, and tutorials from top conferences, top authors, and community leaders who want to share what they know. We create and capture these at the highest quality levels, enhance them with transcripts and other features, and most importantly curate, organize, and publish them to make them easy to find, easy to use, and easy to share. The collection grows with new content published several times every week, and the features we are launching with today are just the beginning.

So, need to get up to speed on the hottest thing in Android dev, Kotlin? Take a look at the new Kotlin Learning Path, a set of eight pieces of content from experts like Donn Felker, Jake Wharton, and Hadi Hariri. Or maybe you want to get deeper on iOS programming paradigms? We’ve got a Learning Path that includes Natasha the Robot’s session on Practical Protocol-Oriented-Programming and Rob Napier on Functional Programming. And if you just want to browse the new sessions from AltConf 2017 or learn everything you need to know about MVVM, that’s easy too.

Getting the Most from Realm Academy

The home page is the launching off point to everything Realm Academy, and the place to check in on what’s new. At the top of the page, you’ll see links taking you off to major Academy sections organized around key categories, including platforms Android, Apple, JavaScript, and Xamarin, plus Realm of course; and focus areas like Architecture and Scaling. As you scroll the page, you’ll see content curated into both Topics and Learning Paths. Topics are collections of all related content, designed for browsing and serendipity—you can find an in-depth answer to a question, but you are as likely to be surprised and inspired by a best practice you didn’t know about before. Learning Paths are smaller and much more focussed—serial collections of content curated to take you point-by-point to a specific topical destination. You’ll also see content organized by event, so, for example, you can see in one place all the content from DroidCon Boston, TrySwift Tokyo, or other conferences.

We’ve got dozens of pieces of new content in process, and much more planned in terms of new Realm Academy features and enhancements, so we recommend checking back often. Or even better, sign up for the Realm Newsletter, which will bring you updates on Realm Academy, new content, and new mobile tech. You‘ll find a field for subscribing on every page.

Join the Realm Community

Realm Academy content comes out of our partnerships with some of the best developers and best developer conferences of the world, contributions from top members of the Realm community, and our own experts here at Realm. We’d love to feature your content too! Send your content contribution proposals—and any other thoughts—to the Realm Academy Team.

Read more

Realm ObjC & Swift 2.9: Set Permissions Based On Usernames, User Info Lookup & Bug Fixes!

by /

We’re releasing version 2.9 of Realm Objective‑C and Realm Swift today. In this release, we’re introducing a way to set permissions based on usernames, a way for administrators to retrieve user information from a Realm Object Server, various improvements, and applying a few bug fixes to keep your apps running strong.

Set Permissions Via Username

It’s now possible to set user permissions based on a user’s username, if they were registered using the Realm Object Server’s built-in username authentication system.

let permission = SyncPermissionValue(realmPath: realmPath,
                                     username: "[email protected]",
                                     accessLevel: .write)
user.applyPermission(permission) { error in
  // ...

Retrieving User Info

Administrator users can now look up the information of users on the Realm Object Server. If an administrator knows a user’s username, they can look up their Realm Object Server identity, which can be used to perform further administrative tasks.

let targetUserIdentity = "[email protected]"
adminUser.retrieveInfo(forUser: targetUserIdentity, identityProvider: .usernamePassword) { (userInfo, error) in
  guard let userInfo = userInfo else {
  print("The user's ROS identity is \(userInfo.identity)")

Sync User Improvements

It is now possible to create and log in multiple Realm Object Server users with the same identity if they originate from different servers. Note that if the URLs are different aliases for the same server each user will still be treated as separate (for example, they will each have their own copy of any synchronized Realm).

If you are creating users using the administrator token, we strongly recommend you specify an authentication server URL when calling the logIn() method. This server URL will become mandatory in a future release for all user types.

Other Enhancements

  • Performance for instantiating Swift objects containing at least one List property has been improved.

Bug Fixes

  • List.description now reports the correct types for nested lists.
  • Unmanaged object initialization when a nested property type returns false from Object.shouldIncludeInDefaultSchema() now works properly.
  • RLMArrays are no longer cleared on self-assignment.

Thanks for reading. Now go forth and build amazing apps with Realm! As always, we’re around on the Realm Forums, Stack Overflow, GitHub, or Twitter.

Read more

RealmContent: Add Real-time Updates to your iOS App in 5 Min

by /



RealmContent coupled with the Realm Mobile Platform quickly gives the developers the ability to add new content into an iOS App by adding data directly into the Realm Browser app.

RealmContent automatically adds the Realm objects it needs into the app’s own schema and allows the developer to use a number of pre-configured View Controllers to list the available content and to render each of the content “pages”.

The component works mostly automatically while it allows for a lot of customization. It saves developers time and drudgery of implementing the underlying plumbing themselves or even having to roll out a completely new version of the app to change in-app content.

The library is the easiest and fastest way to push content in real-time to your complete user base.

How does it work? The technical crash-course

There are five easy steps to add a dynamic content management system to an iOS app.

1) Import RealmContent

Add RealmContent via CocoaPods or include the source files directly into your project. Then import both RealmSwift and RealmContent in a view controller:

import RealmSwift
import RealmContent

Your app would normally have a list of objects it syncs from the Realm Object Server. Once you import RealmContent it will expose two new models which Realm will add to your default schema: ContentPage and ContentElement.

If you’re using multiple Realm files, add ContentPage and ContentElement to the desired object schema.

2) Create a content list data source

To display a list of the available content in your app you can use the ContentListDataSource class that RealmContent provides you with:

let items = ContentListDataSource(style: .sectionsByTag)

Use .plain for a plain list or .sectionsByTag for a list with sections having the pages split by their tag property.

3) Initialize the data source

Call loadContent(from:) to set which realm file to use as the content source:

items.loadContent(from: try! Realm())

You can also have the data source automatically tell your table or collection view to reload the data whenever changes come in from the Realm Object Server (best option):

items.updating(view: tableView)

4) Implement your table view or collection view data source methods like usual, but fetch data from the content data source. The class offers few methods to do that like: numberOfSections, numberOfItemsIn(section:), titleForSection(section:), and itemAt(indexPath:).

This way you can implement your own table view or collection view data source methods and do any UI setup or other logic that you need. (For more detailed code sample check out the demo app in the RealmContent repo.)

5) Presenting a content “page”

Present a ContentViewController instance to display content. You can do this from a table/collection view tap delegate method, prepareForSegue(_:) method, or from an arbitrary piece of code.

Here’s an example of how would it work after a tap on a table cell:

func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
  tableView.deselectRow(at: indexPath, animated: true)

  let item = items.itemAt(indexPath: indexPath)
  let vc = ContentViewController(page: item)

  navigationController!.pushViewController(vc, animated: true)

The presented view controller uses a table view to dynamically show the content from the given ContentPage element. In case you change the content remotely, the changes will be reflected in real-time on screen.

Dynamically add, edit, or remove content

The best aspect of using RealmContent is that you can modify the displayed content at any time - all changes will be synchronized in real-time to all connected users. (And upon connecting for all users who aren’t connected in this very moment of course.)

You can easily use the Realm Browser app to add or remove new pages, add, re-arrange, and otherwise modify blocks of content, and more. You can even change the accent color of your headings and links.

Editing content via Realm Browser

Try RealmContent now

The component is open source and you can find the source code and a demo app here:

The quickest way to try RealmContent in your app is via CocoaPods; add pod 'RealmContent' to your Podfile.

If you have an idea for a feature, want to report a bug, or would like to help us with feedback reach us on Twitter or create an issue on GitHub.

We’re excited to see how far are you going to push this component and the awesome dynamic apps you’re going to create with it!

Read more

Easy End-to-End Encryption: Introducing ZeroKit for Realm

by /

Realm is dedicated to helping you build great apps, and one of the ways we do that is by making it easier to work with the data that powers your apps. Instead of having to write (and maintain) fragile networking and serialization code, the Realm Mobile Platform handles that work automatically, making realtime data sync, sharing, and building server-side data features easy. And of course, we do it securely, offering HTTPS/TLS, AES-256 encryption at rest, and flexible access control features. You are freed to focus on the work that will matter to your users.

But for some apps and some use cases, you need a higher level of data security. That’s why we’re happy to announce end-to-end encryption, with Tresorit’s new ZeroKit SDK integration with the Realm Platform. Now you can easily build realtime, reactive apps that meet the standards required for handling healthcare, government, financial, and other highly sensitive data.

Understanding End-to-End Encryption

End-to-end encryption is the method of choice to protect data transmitted between devices. By encrypting data on the source device before transmission, man-in-the-middle attackers cannot decode the data if they capture it, even if the transmission route itself isn’t encrypted. Only the clients who share the crypto keys can access the information; no other sources potentially snooping traffic, including internet service providers, can see what information is contained within that data. Today, this is standard practice for encrypted chat apps like Signal, Threema, iMessage, and FaceTime.

The challenge is that end-to-end encryption requires a very extensive set of processes to implement, and that can eat up a ton of development time. And if they are not implemented and tested properly, it’s possible to leave flaws that attackers could exploit. End-to-end encryption isn’t impossible or broken—it’s just hard, and it’s important to do it right.

Tresorit + Realm Make It Easy

With the ZeroKit SDK integration for the Realm Mobile Platform, Tresorit built an exceptionally simple, secure, and scalable integration with Realm. Building on their depth of knowledge in building cloud security services, the ZeroKit SDK makes end-to-end encryption accessible to all development teams.

At the core of ZeroKit is an SDK that provides a secure user auth service with end-to-end encryption functionality. This enables the sharing of encrypted data between devices using a single user account and also any number of other accounts which have been granted access.

ZeroKit works on the principle of using the user account system to share encryption keys between client devices. When a new user is invited to view encrypted data from another user, an encryption key is shared in order to decrypt the data. If desired, the key can also be revoked, rendering the data once more inaccessible.

Instead of completely rewriting your backend, you can integrate ZeroKit into Realm without any trouble. Combining the best of both worlds, Tresorit has set up a way to use ZeroKit to perform end-to-end encryption in conjunction with the synchronization capabilities of the Realm Mobile Platform so that your data is end-to-end encrypted while synchronizing seamlessly, in realtime.

How It Works

How it works is actually quite simple. ZeroKit integrates itself with Realm via the Realm Mobile Platform’s ability to allow third-party services to authenticate synchronization sessions. When a user logs into Realm, they use their ZeroKit credentials, which identifies them as a unique user to the Realm Mobile Platform. Once logged in, the encryption keys for that account are made available on that device throughout the user’s login session.

Tresorit diagram

After login, each time a set of data is to be saved, the developer calls a ZeroKit API to encrypt the data on the device. Behind the scenes, ZeroKit stores and uses the keys generated for the current Realm, so that developers don’t have to deal with the complexity of crypto. The encrypted data is then saved to Realm where the information cannot be read successfully by any attacker or even the server itself. To decrypt the data, the same process is repeated in reverse. If the logged-in user has access to the keychain (“tresor”) associated with the Realm, data will be seamlessly decrypted.

To share data with other user accounts, you can combine Realm’s and ZeroKit’s share permissions features. This requires Realm to share the required data and Tresorit to share the appropriate key to decrypt it. The guest user can now read the data with both components. You can also revoke the encryption key, meaning that even if the Realm data file lingers on the guest user’s disk, the information is rendered inaccessible.

In this way, Realm is able to synchronize data out in the open and absolutely nothing in Realm’s stack, or the infrastructure it is run on, is in charge of the encryption. What’s even more exciting is that ZeroKit was built in a way that even Tresorit doesn’t have access to the keys because they are stored encrypted with a secret derived from the ZeroKit user’s password. And Tresorit doesn’t have access to the password either: this is what they call “zero knowledge” service. ZeroKit uses Augmented Password-authenticated Key Agreement (APAKE) protocols to achieve this.

Although end-to-end encryption is all about client-side data access with servers that can’t decrypt data, you don’t have to encrypt everything this way. You can decide to only encrypt sensitive data end-to-end; the rest, you can access on your Realm Object Server. However, if you still need to access encrypted data on the server, you can use ZeroKit’s Node SDK, which enables you to log in a ZeroKit user on the server. Storing the password of this special server user is a task you need to plan carefully though, or ask the Tresorit team’s advice on best practices using Hardware Security Modules and other tricks to keep your product secure.

Combining Realm and Tresorit’s solutions is exceptionally advantageous for use cases requiring enhanced security. In order to compromise data in this architecture, an attacker must both compromise your data and separately steal the keys from every single user, one by one, on their client devices to decrypt it. It’s really fantastic for Tresorit to show us how easy it was to integrate their services into our own, and together, they provide a level of security that is absolutely unparalleled.

The solution is ready for you to experiment with today, just remember you’ll need to do a few more steps before taking the end product into live production to ensure your users’ privacy: for example writing code to validate your users’ email/phone number after registration and arranging certs on your servers. Details are covered in ZeroKit’s documentation.

If you’re building an app dealing with highly sensitive data, we definitely recommend you check out ZeroKit and give it a try!

Read more

Realm Java 3.4 - Reverse Relationship Queries and Sync Progress Listeners

by /

We’re releasing version 3.4 of Realm Java today, and with it introducing reverse relationship queries and sync progress listeners. Read on for all the details.

Reverse Relationship Queries

In Realm Java 3.1 we added beta support for reverse relationships using the @LinkingObjects annotation. In 3.4 we are making it possible to query those relationships as you would with a normal RealmList or RealmObject reference:

public class Person extends RealmObject {
   public String name;
   public Dog dog;
public class Dog extends RealmObject {
   public String name;
   public final RealmResults<Person> owners = null;
// Query for owner as you would a RealmList
Person owner = realm.where(Dog.class).equalTo("", "Jane").findFirst();

Queries on @LinkingObjects work the same way as Link Queries on RealmLists and with this change we are considering @LinkingObjects stable, and are moving them out of beta.

Sync Progress Listeners

Realm Mobile Platform offers a true offline-first experience, where changes can be applied immediately to the local Realm irrelevant of the network conditions. In the background, synchronization happens automatically, and when the network is available, changes quickly propagate across devices and the server. This enables the realtime, collaborative experiences unique to Realm.

There are times, however, when it’s useful to know how much data is left to transfer. Perhaps on the first launch of your app, you’d like to make sure a sizable amount of the data is available before presenting your user interface. At other times, your app will simply benefit from showing when data is synchronizing, by presenting a progress bar or activity indicator.

This is why we’ve added APIs to monitor sync progress by registering ProgressListeners on the SyncSession.

Realm realm = Realm.getInstance(config)
SyncSession session = SyncManager.getSession(config);
// Show progress bar while waiting for an image you just wrote to the Realm
// to be uploaded
session.addUploadProgressListener(ProgressMode.CURRENT_CHANGES, new ProgressListener() {
   public void onChange(Progress progress) {
       if (progress.isTransferComplete()) {
       } else {
// Show a UI hint as long as you are downloading data from the remote server
session.addDownloadProgressListener(ProgressMode.INDEFINITELY, new ProgressListener() {
   public void onChange(Progress progress) {

Note, that currently progress listeners can only be registered if a Realm instance is open.

See the CHANGELOG for the full list of changes.

Thanks for reading. Now go forth and build amazing apps with Realm! As always, we’re around on Stack Overflow, GitHub, or Twitter.

Read more

Bringing Education into the Digital Age with Realm

by /
Thread Learning: Coordinated Autism Education Powered by Realtime Data Sync and Offline-first Capabilities

Each day, special education teachers manually track thousands of data points related to student progress. At the end of the day, they graph that data with a ruler and analyze the results. The process is incredibly cumbersome and time consuming, and paper-based data has significant limitations.


Thread Learning is advancing the way that teachers, parents, and therapists educate children with special needs and autism. Thread Learning’s behavioral data collection platform allows caregivers to record student data using an iPad. The platform then automatically graphs and analyzes the data, provides quality control, and shares the results with all members of a child’s care team, including parents.

Armed with electronic data, a caregiver team can more efficiently coordinate the work of all members to better serve the needs of the student. For example, a child may be working on speech skills with three classroom teachers, as well as a speech therapist and behavioral analyst after school. Thread Learning syncs data in realtime across all team member devices. More informed caregivers means better quality instruction and improved student outcomes.

Building a Coordinated Care Platform

To deliver on their vision of coordinated care, Thread Learning needed a data handling solution that could allow caregiver teams to collaborate in realtime. One of the co-founders was exposed to Realm in a graduate school computer science class. He recognized its potential to enable advanced features that would otherwise be impossible to implement as a nascent startup.

“Realm really helped accelerate our development timeline. We were up and running in weeks instead of months.”
- Sam Raudabaugh, Co-Founder & CTO, Thread Learning

The Thread Learning team initially developed their app using the Realm Mobile Database. This allowed them to bypass the typical headaches of MySQL and an ORM, as well as the technical and resource debt that comes with non-object oriented data solutions.

After the Realm Mobile Platform was released, the Thread Learning team found it a natural progression to explore its more robust data handling and realtime synchronization capabilities. They had been using a REST API to handle data flows, but Realm’s data sync capabilities offered a much better solution. Two-way data synchronization enables a team of caregivers to work simultaneously on the same set of data in realtime.

“We tested Realm against our REST API and the results were impressive.”
- Sam Raudabaugh, Co-Founder & CTO, Thread Learning

Offline-First, Simplified

As school WiFi networks are often unreliable, Thread Learning also needed robust offline capabilities, so that caregivers could still input and access data regardless of connectivity. One of the founders’ early mentors had advised them to avoid offline functionality entirely because it’s “too hard and complicated.” However, the Realm Mobile Platform enables Thread Learning to easily handle networking complexities, such as data updates and conflict resolution, without the issues that typically arise with REST APIs.

Because data loss has historically been a big issue with paper-based processes, Thread Learning especially appreciated Realm’s built-in support for offline-first use cases. With Realm’s client-side database, all app data is stored locally and remains fully accessible when offline, providing a continuous, responsive offline user experience. When connectivity is restored, updates are automatically synced with the Realm Object Server and across all care team devices. Realm’s conflict resolution capabilities ensure that data is always up to date.

“With Realm, we don’t have to worry about what happens when devices go offline and data conflicts happen.”
- Gregory Brill, Co-Founder & CEO, Thread Learning

As the Thread Learning team works on evolving their platform, Realm’s transparency around new feature development helps them plan their own feature roadmap. This helps them better manage their growth and support their mission to serve 1m+ autistic children in the U.S. within the next five years.

“Realm allows us to leapfrog the competition.”
- Gregory Brill, Co-Founder & CEO, Thread Learning

Read more

Realm Events at WWDC 2017

by /

WWDC Week is coming and Realm is planning another week filled with WWDC Events!

Join Realm in San Jose and San Francisco for a variety of events. If you are in town we hope you will join us, and if you are not, tune in on Facebook and Twitter for our second year of “Realm Live from WWDC”. Whether you have tickets to the conference or are in town for other events, we have something planned for you.

  • Keynote Viewing Party: Come see the keynote live streamed at Realm HQ in San Francisco.
  • WWDC Bingo: Play an epic game of WWDC Bingo, powered by Realm, at the Realm viewing party, live at the keynote, or from the comfort of your own home. (Details and app coming soon)
  • Swift Panel: We’re hosting a panel discussion on the second night of the conference in San Jose (Details and registration below - location: Westin San Jose - Across from WWDC and AltConf).
  • WWDC Live @ AltConf: See interviews with WWDC & AltConf attendees, as well as live streams of a variety of AltConf Sessions. Check back for a full schedule.
  • Realm World Tour - San Jose: Join us as we continue the Realm World Tour in San Jose and announce new locations for the Summer!

Keynote Viewing Party

Just because you don’t have tickets to the conference, doesn’t mean you have to watch the Keynote alone. Come by Realm Headquarters in San Francisco for a viewing party, and join other developers as well as the Realm Team to watch the Keynote together. We’ll have brunchy bites and drinks.

When: Monday June 5th, 2017 @ 10am

Where: Realm Headquarters: 148 Townsend St, San Francisco, CA 94107

  • 9am: Doors open! Mix & mingle and grab some breakfast and drinks.
  • 10am: Keynote + WWDC Bingo.
  • Afterwards: Mix and mingle some more and grab a Realm t-shirt on your way out.

RSVP: Reserve your spot!

Swift Panel

Join Chris Lattner, Jesse Squires, Kamilah Taylor and Kevin Ballard as Realm’s JP Simard moderates this panel-style discussion on everything Swift.

When: Tuesday June 6th, 2017 @ 6pm

Where: Westin San Jose 302 S Market St San Jose, CA 95113

  • 6pm: Doors open! Mix & mingle among your fellow Swifters. Drinks and light snacks provided.
  • 7pm: Panel + Q&A.
  • Afterwards: Stay and chat with our panelists, mix and mingle some more.

*IMPORTANT: Capacity for this event is limited. RSVPs are required to attend and will be FIRST COME FIRST SERVED for the first 100 people at the door by 6pm.

RSVP: Reserve your spot!

Realm World Tour - San Jose

We just closed out the first leg of our Realm World Tour (See the highlights), and it was awesome! But we didn’t make it to San Jose, so we are kicking off the second leg of our Realm World Tour during WWDC week. You’ll be able to connect with Realm users who are in town from all over the world, see live Realm demo’s, & learn more about our newly launched Realm Mobile Platform.

When: Wednesday, June 7, 2017

Where: Westin San Jose 302 S Market St San Jose, CA 95113


Read more

Announcing Realm World Tour - The Encore!

by /

Whew! After traveling across 23 cities in less than 2 months in February and March we had to take a little breather.

But now we are back in action and sending more of our top product engineers out across the globe to bring the Realm Platform to you live!

We’ve reached out to leaders of the developer communities in each city, and with their help as local hosts, have planned a great evening for attendees. Each event includes an introduction to the free Developer Edition plus discussion of some of the advanced features, followed by sample code, practical demos, and extensive technical Q&A session — all led by a Realm product engineer. There will also be plenty of time to talk one-to-one, to share best practices, and to learn from each other. And, we’ll have some special attendees-only limited edition Realm swag to give out!

realm-world-tour-facebook We are starting off this leg of the tour in San Jose followed by another stop in Seoul, then onto Toronto, Denver and Atlanta, and adding MORE cities as we go. You can see other stops on the tour here.

Want us to come to you? If you want us to stop in YOUR city, tweet @Realm with hashtag #Realmworldtour and #cityname. We will be tallying votes throughout the tour, so get your friends to vote too! **Bonus points if you hook us up with a local meetup group or host location! ;)

We hope to see you!

The Realm World Tour events are free, but space is limited — check out the official web page for the latest info and chance to register.

Read more

Serverless Logic with Realm: Introducing Realm Functions

by /

Today we’re announcing Realm Functions, a new part of Realm that makes building server-side functionality a lot easier for mobile developers. Now, you can make server-side features without enlisting backend developers, plus you get all the benefits of building on top of the Realm Mobile Platform: you don’t need to add another endpoint to a server, and then write the serialization and networking code that would let you connect with it. You just connect your app to Realm, write a Realm Function in your web dashboard, and watch your code execute reactively as data streams in. Today’s release is a beta, and it’s available today to everyone, whether you’re building an app in an enterprise-scale team or for a small side project.

Performant data storage and realtime data synchronization are important parts of building a great app, but there’s an endless world of possibilities when you can add custom logic to your server. You can write functionality that needs to be protected from tampering, call and coordinate countless other APIs, or use your app’s aggregated data to power machine learning systems. Unfortunately, sophisticated server-side features are hard to build, and hard to integrate with your mobile apps. Even a basic streaming API requires lots of work from the backend developers who will build out the server-side code, and a lot of attention and maintenance so that your apps and server can communicate the data your users need.

Write code that does work, not code that makes work

Realm is deeply committed to getting rid of the roadblocks between you and great apps — and up until now, the bulk of our work has revolved around data. The data you work with in your apps should be easy to save, easy to sync, and easy to respond to as it changes — wherever it changes, and whoever changes it. With Realm Functions, we aim to make it just as easy to create the logic that your app is built on so that you can focus on delivering hard, important features.

In our web environment, you simply write JavaScript to perform the tasks you need, and you’ll instantly see the results as data pours in and your code runs reactively in response. You can breathe a sigh of relief, as adding more features doesn’t also mean adding more fragility and maintenance to your app: you don’t have to add any new serialization or networking code to make a Realm Function work, as the Realm Mobile Platform takes care of getting data to connected clients.

Try out Realm Functions

To show how easy it is, we added a cool new feature to our Realm Tasks app. When you create a task that has a time or date in the title, we’ll use a natural language processing API to turn that into a due date on your task. We did it with just a few lines of code in the app to display the reminder, and a few more lines of JavaScript to call the NLP API and update the Task object. Check out the video, and continue below to get started yourself.


To try it out yourself, just head over to our Realm Tasks repository and follow the instructions there to get started with the Realm Mobile Platform and Realm Functions. Or if you’d like, you can jump right to the Realm Functions documentation.

Realm Functions is a powerful way to add server-side logic to your app through a simple web interface. All Realm Mobile Platform users get access to the Realm Functions beta, and you can start using it today. Today’s beta release lets Developer Edition users try Realm Functions for free with up to three concurrent running Functions; Pro and Enterprise Edition customers have an unlimited number of Functions they can implement. We’re excited to see what you can build using Realm Functions!

Read more

Announcing Realm for Universal Windows Platform

by /

Today, we’re pleased to announce delivery of the most requested feature of our .NET community: Realm Mobile Database for Universal Windows Platform (UWP). UWP support is a major piece in the Microsoft puzzle for Realm—we’ve long had full support for Xamarin, a few months ago we added Win32 support, and a few weeks ago we joined the Azure Marketplace, enabling anyone to get started with the Realm Platform with just a few clicks. All of this has helped make .NET the fastest growing community of Realm developers over the last two quarters.

Realm for UWP means you can use Realm’s world-class object database to build apps for the 400 million mobile, PC, and Xbox devices powered by Windows 10—so you can now use Realm on virtually any modern Windows platform, including the Surface family of devices. For Xamarin developers, UWP support means that Realm now supports all platforms using Xamarin.Forms (Android, iOS, and now, UWP). With Realm and Xamarin.Forms, you can use a single codebase to build apps for all major mobile platforms.

With the addition of UWP, Realm now supports .NET developers across all popular mobile platforms—iOS, Android, and Windows 10—allowing people to use a single persistence and ViewModel layer across all of them. The strength of the Realm .NET community combined with the mobile innovation we see coming out of Microsoft encourages us to continue investing in growing our .NET offerings. We’re excited to share new and exciting tools for the .NET community of developers and we can’t wait to see what you’ll build. It’s as easy as jumping into the documentation.

Read more

Realm Java 3.2: Open Realms Asynchronously, Download Realm, Read-only Flag

by /

We’re releasing version 3.2 of Realm Java today, and with it introducing asynchronously opening a Realm, making read-only Realms as well as more improvements to our synchronized Realm APIs. Read on for all the details on this and more.

Asynchronously opening a Realm

The general recommendation for opening a Realm has always been using Realm realm = Realm.getInstance(configuration). Normally this is extremely fast as we internally cache Realm instances. However, if you have migrations or need to copy an initial file from assets, opening the Realm file for the first time might be a bit slower than you would like.

With 3.2 we now introduce Realm.getInstanceAsync(configuration, callback). This method allows you to open a Realm instance on a background thread and only return once all expensive operations have completed.

One way of using this method can be seen below:

// Let all your activities implement this class
public abstract class BaseActivity extends Activity {
   private Realm realm = null;
   private RealmAsyncTask realmAsyncTask;

   protected void onCreate(Bundle savedInstanceState) {
       realmAsyncTask = Realm.getDefaultInstanceAsync(new Callback() {
           public void onSuccess(Realm realm) {
               if (isDestroyed()) {
                   // If the activity is destroyed, the Realm instance should be closed
                   // immediately to avoid leaks. Or you can call realmAsyncTask.cancel()
                   // in onDestroy() to stop callback delivery.
               } else {
                   BaseActivity.this.realm = realm;
                   // Remove the spinner and start the real UI.
       // Show a spinner before Realm instance returned by the callback.

   protected void onDestroy() {
       if (realm != null) {
           realm = null;
       } else {
           // Calling cancel() on the thread where getInstanceAsync was called on to
           // stop the callback delivery. Otherwise you need to check if the activity
           // is destroyed to close in the onSuccess() properly.

   // This can be overridden by activities so they can start displaying data once Realm
   // is ready.
   abstract void onRealmReady(Realm realm);

Download Realm

Alongside Realm.getInstanceAsync() we also added a new option for synchronized Realms: SyncConfiguration.Builder.waitForInitialRemoteData().

You can enable this option to force Realm to download an initial dataset from the server before reporting the Realm as ready to be opened. This can be beneficial if it doesn’t make sense for your app to display anything until it has a full dataset available. “Full” is determined by the point in time the client contacts the server, so if more data is written by other devices in the meantime, they are not taken into consideration. These changes will of course continue to synchronize in the background after the Realm has been opened.

SyncConfiguration config = new SyncConfiguration.Builder(getUser(), getUrl())

// This will not be called until the remote Realm has been fully downloaded.
Realm.getInstanceAsync(new Realm.Callback() {
   public void onSuccess(Realm realm) {
       // Use Realm

This dataset will only be downloaded the first time the Realm is opened i.e., no local Realm file exists. After that, the Realm will be opened immediately.

Read-only Realms

With 3.2 we also enabled the option to create read-only Realms. These can be useful if you do not want to accidentally write changes to a Realm file.

RealmConfiguration config = new RealmConfiguration.Builder()
       .modules(new MyModule())

SyncConfiguration syncConfig = new SyncConfiguration.Builder(getUser(), getUri())
       .modules(new MyModule())

Marking a Realm as read-only will cause all transactions against that Realm to throw an IllegalStateException.

Note this also prevents writing any schema information to the file, so marking a Realm as read-only only makes sense if you at the same time either set RealmConfiguration.Builder.assetFile() or SyncConfiguration.Builder.waitForInitialRemoteData().

Since the Realm schema is automatically created from all known Realm model classes, there can be an advantage to explicitly enumerate all classes in the provided file. This is done using modules.

Refreshing a Realm

Calling Realm.refresh() will force all asynchronous queries to be synchronous in order to provide a consistent view of the underlying data. You should only use refresh() if you are not using any asynchronous queries.

With the changes introduced to iterators in 3.0, it has now been possible to add Realm.refresh() back after popular demand.

Calling Realm.refresh() will force any Realm instance to the latest version of the database as well as trigger any registered notifications. This has especially been useful if you are using some other notification system than Realm notifications, e.g. event busses.

Other improvements

  • It is now possible for SyncUsers to change their password using the new SyncUser.changePassword(password, callback) API.
  • It is now possible to ask if a given SyncUser is an administrator on the Realm Object Server by calling SyncUser.isAdmin(). Admin users have special capabilities like changing permissions for other users.
  • Transient fields in Realm Model classes will now be treated as implicitly having the @Ignore annotation.
  • DynamicRealmObjects now support reverse relationships as well using DynamicRealmObject.linkingObjects(String parentClass, String parentField).

See the CHANGELOG for the full list of changes.

Thanks for reading. Now go forth and build amazing apps with Realm! As always, we’re around on Stack Overflow, GitHub, or Twitter.

Read more

Realm Events at Google I/O 2017

by /

Are you headed to Google I/O? Join Realm in Mountain View and San Francisco for some I/O fun! Whether you have tickets to the conference or are just in town for the other events, we have something planned for you.

  • Women in Android Panel: Realm and San Francisco Android Developers are hosting a Panel discussion on the second night of the conference at Realm Headquarters (Details and registration below).

  • Google I/O Scavenger Hunt and Realm Swag: Can’t make it to San Francisco but still want in on the fun? Don’t worry, look for us at Shoreline on Wednesday before the Keynote. We will be handing out details about our Google I/O Scavenger Hunt and some fun Realm swag.

Google i/o Scavenger hunt

Women in Android Panel

Realm and the SF Android Developers Meetup invite you to our Google I/O Women in Android Panel.

Join Stacy Devino, Caren Chang, Angella Derington, and Nicolette Yadegar, with Britt Barak from Women Techmakers Tel Aviv as she moderates this panel-style discussion on everything Android.

When: Thursday May 18th, 2017

  • 6pm: Doors open! Mix & mingle among your fellow Android Devs. Drinks and snacks provided.
  • 7pm: Panel + Q&A
  • Afterwards: Stay and chat with our panelists, mix and mingle some more.

*IMPORTANT: Capacity for this event is limited. RSVPs are required to attend and will be FIRST COME FIRST SERVED for the first 150 people at the door by 6pm. RSVP ON EVENTBRITE


Stacy Devino is the head of Mobile Apps for one of the fastest growing FinTech companies in the US. Prior to that she was the technical lead for Android Apps at Home Depot. Stacy has been doing this since Android 1.6 and has worked in embedded Android operating-system-level as well as hybrid and consumer applications.

Caren Chang studied Computer Science at UC Berkeley and has been around the Bay Area ever since. Previously she worked at companies such as Dreamworks and VSCO, and is currently helping build smart ovens at June. Her favorite part of Android development is working with custom views and animation.

Angella Derington is a seasoned Android developer with a passion for creating experiences that delight the user in their simplicity and polish. In the last few years, she has been busy working on the Android apps for major retailers. When not building apps, Angella keeps herself busy with her two kids, dog, and two cats!

Nicolette Yadegar is currently the Technical Lead for Support Engineering on Microsoft’s Yammer Android team. As Team Lead, she focuses on Performance and QA, while working on internal projects including upgrading/adding new libraries, adding fun features like GIF support, and refactoring efforts. Before that she worked at Microsoft on their IoT Innovation team and their Frameworks & Services team.

Britt Barak (Moderator) is co-leading Android Academy TLV which is one of the largest and most active Android communities out there. Britt is also leading the Women Techmakers Israel community. She is on a mission of sharing knowledge and inspiring others. You can find her public speaking, mentoring and blogging on Android development at .

This panel is presented by Realm, a platform to build reactive apps, realtime collaborative features, and offline-first experiences.

Read more

Arccos Golf Ups its Game with Realm

by /

Delivering fast, responsive app experiences online and offline

A golfer’s game depends on good decisions with every shot. Performance data, captured and analyzed in realtime, can help players improve their skills mid-game and make better decisions throughout the course. As the field of connected sports gains momentum, Arccos Golf is using today’s innovative IoT and mobile technologies to re-invent one of the world’s oldest games.


The company’s innovative shot-tracking system pairs small, ultra-light golf club sensors with a mobile app and analytics platform. Using GPS and Bluetooth, Arccos automatically captures data on every shot, analyzes a player’s strengths, weaknesses, and trends, and delivers feedback through the mobile app in realtime. Such data-driven insights can dramatically improve a player’s ability to make the right decisions at every hole.

In order to deliver on their vision, Arccos needed to provide a fast, seamless user experience with zero disruption to the player’s golf routine. Their system had to handle significant data flows from sensor data capture and analytics processes, as well as from rendering detailed course maps and a rich UI—all in realtime. Because users expect apps to function wherever they are, the Arccos mobile application needed to work on remote golf courses where mobile connectivity may be unreliable.

Three different models for handling data

Originally, Arccos outsourced the development of an Android app that took a traditional approach. The app used RxJava and OrmLite, SQLite. However, the performance for this model was unacceptably low and the Arccos development team had to persist data as JSON blobs as a workaround. To translate data between models and keep it all in sync, the Arccos development team had to write a massive amount of code. This meant significant time spent debugging and maintaining code, which distracted the team from focusing on new development. Arccos users experienced frustratingly slow app performance, which inhibited their ability to get the most out of it. Arccos knew that they had to re-architect their system in order to make it more efficient and sustainable.

Unified data model on Realm

Arccos decided to explore a simplified data solution using Realm, and they started by building a proof of concept to evaluate this new approach. The development team was initially impressed with how quickly they could get Realm up and running — no lengthy boilerplate code or set up processes needed. More importantly, switching to Realm resulted in a significant increase in transaction speed.

“With Realm, we noticed a huge improvement in the loading time of one of our asset classes. What used to take 6 seconds, now takes about 20 milliseconds. The speed was impressive.”
- Muhammad Arafat, Android Team Lead, Arccos Golf


Arccos found that Realm’s reactive architecture enabled a fast, responsive user experience, regardless of network connectivity. In the golf course environment, offline usage is critical. The team was particularly happy with Realm’s support for offline-first use cases. Realm persists data locally on device, which enables users to access all app data while offline.

“Realm’s fast local storage allows us to provide an extremely responsive app experience, both online and offline.”
- Colin Phillips, VP of Software, Arccos Golf

Realm’s single data model allowed Arccos to simplify their system architecture, streamline app code, and more easily improve stability. Because app data is stored as objects, the database didn’t “get in the way” and distract the team with tedious data translation tasks, making it much easier to implement a pure object model that worked well for their application. In addition, Realm only pulls into memory the parts of the object that you actually need or are actually touching. This effectively spreads the transaction time across user actions ensuring a seamless experience for the user.

“Re-architecting our app on Realm shrank our code base by about 35%, making it much easier for us to debug and maintain.”
- Colin Phillips, VP of Software, Arccos Golf


Using platform tools, such as the Realm Browser, the Arccos team found that they were able to discover and troubleshoot bugs much faster. The browser helped Arccos ensure that their objects were structured correctly, see the one-to-one mapping across objects in memory and the database, and quickly identify any issues.

Ultimately, migrating to Realm has been a game-changing decision for Arccos. Players now experience a highly responsive app that works well on a remote golf course. The development team can now move faster and spend more time building new ways to help players become better golfers.

Read more

Realm Platform on Azure: Easiest Path to Realm in the Cloud

by /

Today we’re pleased to announce the availability of Realm Mobile Platform, Developer Edition, on Microsoft’s Azure Marketplace.

The Realm Platform has always been easy to install — we offer a Linux and Mac version, a public AMI for Amazon Web Services, and detailed instructions for Digital Ocean — but if you have an Azure account, this is by far the easiest way to get started. You simply find us in the Marketplace, and in a few clicks (see the steps below), you can have your own instance of Realm’s Developer Edition immediately available. It’s free and you can use it for almost anything – though of course fees for Azure may apply.

This is really just the beginning — we’re now an official Microsoft partner, and are working on making the other Realm Platform editions available on Azure. And we’re on the same path with the other major cloud platforms as well, so stay tuned.

Getting Started on Azure

Sign into your Azure account (or create one), then click the green plus sign (+) on the left to get access to the Marketplace. Enter Realm in the search box and choose the result. You’ll be walked through Azure’s quick and pretty straightforward five-step process to get your server configured. The necessary ports for Realm — 9080 and 22 — are preset. Other than naming things and setting up SSH, you can pretty much accept all the defaults.


Following step five, it takes a minute or two for deployment, after which you’ll see the details of your new server, including the IP address. Open a new tab, copy that into the address bar, add :9080 to the end, and hit enter — you’ll see the Create Admin User panel for your shiny new Realm Object Server instance running Azure. Success! Now you are ready to start exploring the platform — start with one of our fun demo apps, like Realm Pop (realtime gameplay), Realm Draw (realtime collaboration), or Realm Tasks (realtime task management).


Read more

Realm ObjC & Swift 2.7: Permission APIs, Fast Reconnects, Password Change & Bug Fixes!

by /

We’re releasing version 2.7 of Realm Objective‑C and Realm Swift today. In this release, we’re introducing improved permission APIs, faster reconnects, password change and applying a few bug fixes to keep your apps running strong.

Improved Permission APIs

We’re introducing new APIs for changing and retrieving permissions for synchronized Realms.

These APIs are intended to replace the existing Realm Object-based permissions system that were introduced in 2.0.4 and 2.4.4.

For example, the previous way to grant or revoke permissions was to create a {RLM}SyncPermissionChange object in the user’s managementRealm().

You could then observe that “change” object to be notified when the server had processed it, and whether or not the operation was successful.

let permissionChange = SyncPermissionChange(realmURL: realmURL,    // The remote Realm URL on which to apply the changes
                                            userID: anotherUserID, // The user ID for which these permission changes should be applied
                                            mayRead: true,         // Grant read access
                                            mayWrite: true,        // Grant write access
                                            mayManage: false)      // Grant management access

let managementRealm = try! user.managementRealm()
try! managementRealm.write {
// Wait for server response
token = permissionChange.addNotificationBlock { _ in
  switch permissionChange.status {
  case .notProcessed: break // handle case
  case .success: break // handle case
  case .error: break // handle case
  print(permissionChange.statusMessage) // contains error or informational message

Retrieving permissions used a separate Realm (SyncUser.permissionRealm()) and a separate model type (SyncPermission).

let permissionRealm = try! user.permissionRealm()
let permissions = permissionRealm.objects(SyncPermission.self)
token = permissions.addNotificationBlock { _ in
  // permissions updated

These APIs have now been deprecated in favor of a simpler family of permission APIs that don’t require knowledge about how the internal transport mechanism is implemented.

There’s now a single {RLM}SyncPermissionValue type that should be used to apply, revoke and retrieve permissions:

// Applying permissions
let permission = SyncPermissionValue(realmPath: realmPath,
                                     userID: anotherUserID,
                                     accessLevel: .write)
user.applyPermission(permission) { error in
  if let error = error {
    // handle error
  // success!
// Retrieving permissions
user.retrievePermissions { permissions, error in
  if let error = error {
    // handle error
  // success! access permissions

You’ll find more documentation for using Realm’s Permissions APIs in the Access Control section of our docs.

These APIs require any edition of the Realm Object Server 1.1.0 or later.

Faster Reconnects

This release detects changes in connectivity status via the Reachability framework to instantly attempt a reconnection with the object server if the connection was not sustained.

Previously, the time before reconnection occurred was dependent on how long it had been since the connection was lost due to our exponential backoff reconnection algorithm.

Password Change

Users can now change their passwords using the -[RLMSyncUser changePassword:completion:] API if using Realm’s ‘password’ authentication provider. This API requires any edition of the Realm Object Server 1.4.0 or later.

Other Enhancements

  • {RLM}SyncConfiguration now has an enableSSLValidation property (and default parameter in the Swift initializer) to allow SSL validation to be specified on a per-server basis.
  • Transactions between a synced Realm and a Realm Object Server can now exceed 16 MB in size.

Bug Fixes

  • Support Realm model classes defined in Swift with overridden Objective-C names (e.g. @objc(Foo) class SwiftFoo: Object {}).
  • Fix -[RLMMigration enumerateObjects:block:] returning incorrect oldObject objects when enumerating a class name after previously deleting a newObject.
  • Fix an issue where Realm.asyncOpen(...) would fail to work when opening a synchronized Realm for which the user only had read permissions.
  • Using KVC to set a List property to nil now clears it to match the behavior of RLMArray properties.
  • Fix crash from !m_awaiting_pong assertion failure when using synced Realms.
  • Fix poor performance or hangs when performing case-insensitive queries on indexed string properties that contain many characters that don’t differ between upper and lower case (e.g. numbers, punctuation).

iOS 7 Support

We’d like to remind you that we will continue to support a minimum target iOS version of 7.0 as long as we can, but will be increasing the minimum target iOS version to 8.0 in a future release.

Thanks for reading. Now go forth and build amazing apps with Realm! As always, we’re around on the Realm Forums, Stack Overflow, GitHub, or Twitter.

Read more