A good way to implement a tweeter-like tracking device system?

I am trying to create a tweeter-like tracking system (users can follow each other). I am embarrassed by a good way to maintain the relationship of followers. I am using JDO (in google engine).

The first thing that comes to mind is to keep a set for followers and the ppl that you follow. Sort of:

class User {

   private String mUsername;

   private Set<String> mFollowers;

   private Set<String> mFollowees;
}

I'm worried about what happens when these sets grow to have 10,000+ entries in them. Viewing the user page would be a normal operation, and I would not want to download all the sets every time my API needs to generate user information. In any case, I will only show 50 followers, so it makes no sense to download the whole set.

, User. ( ). , , , :

class RelationshipInfo {

    private String mMyUsername;

    private String mUsernameYouAreFollowing;
}

, , 50 , . ? , , . .

,

+1
1

, App Engine , Google I/O Twitter , , , , , .

, Jaiku, Twitter , App Engine.

+5

Source: https://habr.com/ru/post/1746878/


All Articles