BT

New Early adopter or innovator? InfoQ has been working on some new features for you. Learn more

Realm Launches New Database for React Native

| by James Chesters Follow 1 Followers on Feb 24, 2016. Estimated reading time: 2 minutes |

Realm has launched a new database for React Native, Facebook's platform for building React apps with JavaScript.

The mobile database from Realm is designed to "enable reactive app development, with live objects, change events, and support for unidirectional data flows" and aims to allow developers using Facebook’s JavaScript framework to quickly model, store, and query data through an intuitive interface specifically designed for JavaScript.

Realm React Native looks like this:

const Realm = require('realm');

class Person {}
Person.schema = {
    name: 'Person',
    primaryKey: 'name',
    properties: {
        name: 'string',
        age: {type: 'int', default: 0},
    },
};

const realm = new Realm({schema: [Person]});

// Query
let people = realm.objects('Person', 'age >= 17');
people.length // => 0

// Write
realm.write(() => {
    savedPerson = realm.create('Person', {
        name: 'Hal Incandenza',
        age: 17,
    });
});

// Queries are updated in real-time
people.length // => 1

Announcing the company's move into JavaScript, Tim Anglade, VP of product at Realm, said “React Native mirrors some of our most important priorities at Realm: enabling a native UI experience and reactive cross platform functionality that accelerates the development process and empowers developers,”

“As we see increased demand from our customers for React Native compatibility, we are excited to be the first third-party platform to offer integrated support,” Anglade said.

Already using the integrated database is the errand outsourcing startup TaskRabbit. Brian Leonard, company co-founder and chief architect for TaskRabbit, said managing the code for app across platforms was previously "exhausting," but using Realm and React Native had allowed them to port the app to a seamless cross-platform system. The change has quadrupled the team's productivity, Leonard said.

Describing itself as the fastest React Native database, Realm have published benchmarks commenting "although we always recommend everyone test their own use-cases, we usually see huge speedups when porting code."

Realm's announcement was met favourably by many in the developer community, including attendees of Facebook’s React.js Conference who took to Twitter to comment on the news.

Commenting on a link to the announcement on Hacker News, TaskRabbit's Brian Leonard was first to congratulate the Realm team, saying "We've been really happy trying it out. It's a drop-in replacement for the standard flux pattern." Realm contributor Kristian Dupont also commented "I think this is a very exciting match for both eco systems. I look forward to seeing where it will go."

The Realm team note that they plan to add support for Cordova/PhoneGap/Ionic, and Node.js (V8) compatibility in the future.

Rate this Article

Adoption Stage
Style

Hello stranger!

You need to Register an InfoQ account or or login to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Tell us what you think

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread
Community comments

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Discuss

Login to InfoQ to interact with what matters most to you.


Recover your password...

Follow

Follow your favorite topics and editors

Quick overview of most important highlights in the industry and on the site.

Like

More signal, less noise

Build your own feed by choosing topics you want to read about and editors you want to hear from.

Notifications

Stay up-to-date

Set up your notifications and don't miss out on content that matters to you

BT