On 07.12.2012 22:25, kyle Hailey wrote: > Here is an interview question using facebook for an example. > It's a data modeling question that applies to a lot of social network sites > and startups: > http://dboptimizer.com/2012/11/07/facebook-news-feed-performance/ > > I haven't answered the question, just provided some ideas. > > - Kyle > > sorry, I just look at the top of the message. And answering Your question: Assuming they use MySQL for this I would built the 3rd table (ie Updates) with facebook account id or email (id is better, because shorter of course) and pk would be something like facebook account id, artificial key assuming we want the updates in a chronological order or facebook account id, contact id, artificial key assuming ordering updates by contacts or facebook id, thread id, artificial key assuming updates in chronological order of topics (top updates) with grouping answers to the update with top, which is most similar towhat I have seen on facebook. This would be quite efficient, but certainly they would need at such traffic to partition the data on the application level. Regards Remigiusz -- Pole na kazi ---------------------------------------------------------------------- Remigiusz Sokolowski <remigiusz.sokolowski@xxxxxxxxxx> pos : Senior DBA at DIiUSI addr : Nordea Bank Polska SA, Luzycka 6A st, 81-537 Gdynia, Poland phone : +48 58 667 17 43 mobile: +48 602 42 42 77 Nordea Bank Polska S.A. z siedziba w Gdyni, ul. Kielecka 2, 81-303 Gdynia, wpisana do Rejestru Przedsiebiorców Krajowego Rejestru Sadowego pod numerem: 0000021828, dla której dokumentacje przechowuje Sad Rejonowy Gdansk - Pólnoc w Gdansku, VIII Wydzial Gospodarczy Krajowego Rejestru Sadowego, o kapitale zakladowym i wplaconym w wysokosci: 277.493.500,00 zlotych, NIP: 586-000-78-20, REGON: 190024711-- //www.freelists.org/webpage/oracle-l