Data structure for Salvatore’s Twitter clone in Redis
If you’re interested in Redis, you should definitely check real-world scenario, @antirez’s tutorial on building a Twitter clone in Redis and PHP. It’s worth to pay close attention how all the information is modeled in Redis, so I have put the overview of the architecture in the following gist:
You’ll notice the need for a really heavy de-normalization. It’s a useful reminder that you just can’t query anything by the value — as we are used to do in relational databases or CouchDB, MongoDB and such. In Redis and similar databases, the querying is done only by the key.
Comments