Here's a list of articles as to how to scale/designing your application architecture - Sharding Pinterest: How we scaled our MySQL fleet.
Read this. The basic idea is to count the number of unique users. Since the complexity of the problem grows with the users maintaining a count of unique users becomes a space issues. Apart from what's written in the blog I would suggest having a look at the hyeprloglog algo or having a bloom filer.… Continue reading Design a hit counter