[erlang-questions] Twoorl: an open source Twitter clone

YC yinso.chen@REDACTED
Sun Jun 1 03:53:04 CEST 2008


> You have M users and each user follows an average of N other users. To
> render a user's timeline, you need to present the latest 20 tweets
> (twoorls in the new terminology :) ) from all his friends. The naive
> way to do it is to fetch N*20 messages, sort them, then take the first
> 20. This is expensive to do when N is big. Another problem is that
> because of the frequent updates from typical users, caching this
> calculation doesn't give you much because the cache gets frequently
> invalidated between page loads.
>
> The only solution I see is to keep a "latest twoorls" store for each
> user. When a friend sends a new twoorl, it (or a pointer to it) is
> copied to the twoorl store for all his friends. This trades space for
> speed, and it limits the paging you can do to see your twoorl history,
> but it's the only way you can scale this kind of service when N is
> big.
>

It seems the solution will look similar to emails and mailing lists, which
both are quite scalable.

Except in this case every account is also a broadcast mailing list.

Cheers,
yc
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20080531/456287a1/attachment.htm>


More information about the erlang-questions mailing list