1

I have a public partition in which data is structured as

_id  task  userId
1    task1 User1
2    task2 User2
.................

I need to fetch and sync data based on userId.

Partition by userId is an option,but i don't want this.

Use Case: Take a example of Chat App where users can interact One to One and in a group.

My Findings: I need three type of partition

A. based on user id (user specific)

B. based on conversation id (conversation specific)

C. public (has user info)

My Doubt:

  1. Suppose i have 10 contacts and public partition has 100 users,how do i get only contact specific list and sync.(Docs suggests you will get all data of a partition)

  2. Suppose my user base increases to 100 thousands,I have to maintain 100 thousands partitions and same for conversations.

I Want

Maintain a collection has user and conversation table/schema. Fetch and sync data using User id.

satish ray
  • 117
  • 1
  • 10
  • Yes, it is possible. However, asking if something is possible is pretty vague as we don't know the use case. For example, if you're asking if you can query Realm for all tasks created by User1, sure, and that's covered in the docs. Can you clarify the question? – Jay Sep 24 '21 at 17:31
  • Hey Jay, I have updated the question.Please have a look. – satish ray Sep 25 '21 at 04:40
  • The question is still a bit vague. If your use is; a user can interact one-on-one and in a group, you'll need partitions for each one-on-one chat as well as one for the group chat. So it's not clear why you need A. Overall design choices are really not a good fit for SO as this is a coding specific forum; if you have a section of code you're having difficulty with, post it and we'll take a look. Otherwise there are just too many variables; security issues, queries, what you do/don't want to sync etc. I would suggest the Realm forums may be a better place for this question. – Jay Sep 27 '21 at 17:18
  • When you say partition, do you mean creating another index? – Junaid Jun 24 '23 at 12:32

0 Answers0