I am designing a Feeds system, that one can post news, and others can see each other's news, just like the Twitter.
Now I'm saving the news in HBase, and cache them in Redis. This approach has O(1) insert, update and remove, but the "count" is something hard to achieve:
If I save a separate count in Redis, and increasing/decreasing it upon insertion/removal, the value can be easily not consistent with the real list length in Hbase: one single failure on the network or some other exception can make the value wronged.
If I get the count from Hbase, it's very time consuming.
What design choice should I make?