Case Study: Twitter

In this article I’ll describe the design and implementation of a simple clone of Twitter written using PHP with Redis as the only database. The programming community has traditionally considered key-value stores as a special purpose database that couldn’t be used as a drop in replacement for a relational database for the development of web applications. This article will try to correct this impression.

Our Twitter clone, called Retwis, is structurally simple, has very good performance, and can be distributed among any number of web and Redis servers with very little effort. You can find the source code here.

I use PHP for the example since it can be read by everybody. The same (or… much better) results can be obtained using Ruby, Python, Erlang, and so on.

Note: Retwis-RB is a port of Retwis to Ruby and Sinatra written by Daniel Lucraft! Full source code is included of course, and a link to its Git repository appears in the footer of this article. The rest of this article targets PHP, but Ruby programmers can also check the Retwis-RB source code since it’s conceptually very similar.

Note: Retwis-J is a port of Retwis to Java, using the Spring Data Framework, written by Costin Leau. Its source code can be found on GitHub, and there is comprehensive documentation available at springsource.org.

<More Information : http://redis.io/topics/twitter-clone>

Leave a comment