I started to get interested in how to design and implement Twitter. I have a question!!!. I couldn’t sleep for several days because of this problem.
A lot of users on twitter have many 'following'. There are more than 20,000. Some have many 'followers' like TechCrunch has 352,835. For example, 1. User A has 20,000 following and has 500,000 followers. 2. User A updates a message on his twitter. 3. Followers of User A can see the message from User A. If you design database, how do you solve it? Users to Messages is Many to Many. If you want mapping table for solving it, whenever user A update his messages, Application have to insert them 500,000 times. If you want method of ‘Pull’, You should select from Messages table using “OR or IN” operator. I think both of them have serious problems. Do I have to consider another solution? like Search?? I am waiting for good opinions from you. :-)
