Note that there are some explanatory texts on larger screens.

plurals
  1. POhow to Solve the "Digg" problem in MongoDB
    primarykey
    data
    text
    <p>A while back,a Digg developer had posted this blog ,"<a href="http://about.digg.com/blog/looking-future-cassandra" rel="nofollow noreferrer">http://about.digg.com/blog/looking-future-cassandra</a>", where the he described one of the issues that were not optimally solved in MySQL. This was cited as one of the reasons for their move to Cassandra.</p> <p>I have been playing with MongoDB and I would like to understand how to </p> <p>implement the MongoDB collections for this problem</p> <p>From the article, the schema for this information in MySQL :</p> <pre><code>CREATE TABLE `Diggs` ( `id` INT(11), `itemid` INT(11), `userid` INT(11), `digdate` DATETIME, PRIMARY KEY (`id`), KEY `user` (`userid`), KEY `item` (`itemid`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; CREATE TABLE `Friends` ( `id` INT(10) AUTO_INCREMENT, `userid` INT(10), `username` VARCHAR(15), `friendid` INT(10), `friendname` VARCHAR(15), `mutual` TINYINT(1), `date_created` DATETIME, PRIMARY KEY (`id`), UNIQUE KEY `Friend_unique` (`userid`,`friendid`), KEY `Friend_friend` (`friendid`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; </code></pre> <p>This problem is ubiquitous in social networking scenario implementation. People befriend a lot of people and they in turn digg a lot of things. Quickly showing a user what his/her friends are up to is very critical.</p> <p>I understand that several blogs have since then provided a pure RDBMs solution with indexes for this issue; however I am curious as to how this could be solved in MongoDB.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload