8

If I want to share some data between users, what is the best strategy with Realm Object Server. For instance 5 users want to share their favorites movies. Everybody share 3 movies and they should see a list of 15 movies.

Alan Digitals
  • 175
  • 1
  • 5

1 Answers1

1

If all users share all their favourite movies, they could each have their own realm to write to. You can give all other users read permissions to that realm. By keeping a reference of all realms(in a realm where everybody has read/write access), a user would load data from all other users and thus see their own and the others' favourite movies.

  • "By keeping a reference of all realms(in a realm where everybody has read/write access)". That's mean I have to manage an external table with all the referencies? In addition to Realm I have to use another database? – Alan Digitals May 08 '17 at 13:07
  • You don't have to use another database. I was suggesting you keep use another realm(where everybody has read/write access) to storing the path to each of the users realms with movies. e.g. `/moviesRealmsList` - a list of all users moviesRealms (R/W to all), each user can have its realm with movies `/~/moviesRealm` (R to all, R/W to current user), each user can also have other private realms, for example a list of movies to watch : `/~/toWatch`(R/W to current user) – Radu Tutueanu May 09 '17 at 08:53
  • I get it, I thought about this solution. The problem is the size o this table. It works for few users. It will be too big for thousand of users. – Alan Digitals May 09 '17 at 09:13
  • Who should create the shared database? any user or the admin? I've tried to create a Realm without the ~ but I can't see it on the server – Alan Digitals May 13 '17 at 13:42