Alex Rivera | Logout

How would you implement twitter using a noSQL kind of DB?

Asked 2010-07-12T12:00:40.650
10

It seems like implementing web-app like twitter/facebook-wall needs 1 huge "feeds" relational table (+ a user table) and an awesome caching mechanism.. ( can you recommend one? )

my main question is, how would you implement such a "feature" using a non-relational DB, e.g. a key/value kind of DB?

Obviously, I had like to support the amount of users using twitter concurrently and in general.

Thanks

Edit
Report

2 Answers

2

I recently wrote a minimal implementation of twitter data layer using HBase. If you are interested you can have a look at the gist : https://gist.github.com/1101316 . The first file CreateTwitterTable.java has the code to create the hbase tables and their related column families. The second file TwitterClient.java has the code for the basic functions such has getTimeline, addTweet, deleteTweet, followUser, unfollowUser and addUser.

answered 2011-07-26T09:41:44.330
0

Obviously, I had like to support the amount of users using twitter concurrently and in general.

Sorry but this requirement is far away from being realistic. Twitter has a huge server farm to shard the data for supporting their massive concurrency, do you have as much servers as twitter?

There is an architectural idea implementing a twitter clone with redis: TwitterAlikeExample

answered 2010-07-31T11:39:19.337

Your Answer