Design "dynamic" relationship replication


I am fairly new to sync gateway and I am facing a design issue. (sorry if it has already been asked)

Consider the following project:

  • I have many user on mobile.
  • Each user create many ‘notepad’(s)
  • Each user may search any ‘notepad’, and follows (read-only) it.

For a given user I would like to sync its own ‘notepad’(s) and the one(s) he is following (and not all existing notepad).

I cannot find a nice and clean design to do this …

I am ok with Sync function to replicate document with owner = user but I am stuck with the dynamic link ‘following’ notepad of another user without replicating the whole universe.

Another idea I had was to set a channel by notepad (1 channel = 1 notepad) then generating ‘following document’ which grant to an user a channel a.k.a. a notepad. But this will lead to many many channel…

If someone have any leads…