NeoKree
NeoKree

Reputation: 409

Which type of applications can I build with the Realm Mobile Platform?

I discovered Realm Mobile Platform recently, but I'm not sure what it really is.
After reading the documentation seems like a way to sync and store all data from the device to the server with a minor impact from the application side. What I tipically call Cloud.

But it's presented in realm.io homepage like:

Realtime collaboration in as little as 10 lines of code


Which is good, but I haven't see any code in documentation or examples to retrieve other user-ids other than mine. It seems that you can do 'Realtime collaboration' only hardcoding a user credential inside the app and use a single user to work on the same realm. Realm Permissions seems useless to me because a normal user cannot see other users or other realms.
Another thing I have seen is the Realm Event Framework, available for Professional and Enterprise edition, that partially resolve the problem of connection, adding the feature to edit objects on specific events.
But in apps where users communicate to each other, like a messanger or a social network, I cannot use events to create data from first user realm to the second user realm, is totally incorrect without an object permission management from server because in my realm I can obviously edit all objects, but that object could be created by another user.

In a chat thread I cannot have the power to delete my friends comments freely, I cannot let the client app have the permission to do that.

Another example could be the 'friends' concept. Is impossible to create it, because the information should be shared between the two users and creating a Realm shared between all users that store connections between users allows all users to see all friendships or even worse manage other people friendships.

So Realm Mobile Platform can be great for an example app, a demo, a handy cloud solution to sync between devices but I cannot use it to substitute my RESTful webservice?

Upvotes: 2

Views: 912

Answers (2)

NeoKree
NeoKree

Reputation: 409

Short answer: without Professional or Enterprise edition you can only create a cloud for your users at this time.

Actually Realm Object Server Developer edition is a way to upload a mobile realm database on a online server. Nothing more, nothing less.
Fine-granted (object-level) permission will be developed in future and selective synchronization will be also a future feature. The new Access control feature allow to set database user permission for every realm. It allow only certain users to read/write/change permissions to the selected online realm object.

So if you are thinking to create a global realm shared between all users, PLEASE DON'T.
A shared realm synced with all users means that all users will download all informations, so if your app grows a new user will download about 100/200/500/1000MB in his device only to see his 0.0/0.2% of data. And I haven't talked about security.

Paid solution [Professional And Enterprise edition]

"Event handling to the rescue."

Even if it sounds a little weird, events are the way you can create a service with user permissions.
But you need to think to your app from the mobile perspective, with events that manage data to other users database.

A little example:
I have a chat thread with three components. A,B and C.
Every user has his own realm on server, with a copy of his local database.
Now A post a comment. When it sync to Realm Object Server the event handler trigger a procedure that will open B and C realms and insert this new comment on the chat thread. Then when user B and C will open the app the new comment will be synced.

In the same way you need to control user permissions, so user A will not edit a user B comment on B and C realms, and will restore B comment on A realm because it have not the permission to edit that object.

Obviously this solution will duplicate informations for every user which have access to that object.

Upvotes: 1

Adam Fish
Adam Fish

Reputation: 1543

There are lots of different apps that can be built with Realm Mobile Platform. We have started cataloging a list of demo apps here, hopefully they could help you get started.

Upvotes: 1

Related Questions