Hello,
so this chapter suggests storing the Post object itself in the cache as well, my question is that why not just store the PostID in the cache, it would reduce the size of cache significantly:
lets say: Cache = Hashtable{userID, sortedset(PostID)}
est size = 8 bytes + (8+20(Sortedset overhead)) * 500 + 20 (hashtable overhead) = 14 k bytes/ user * 300MillionUsers = 4.2 TB -> 42 machines (vs 1500 if we store the entire Post)
Later the Newsfeed service would hydrate this with the actual posts, on-demand.
cheers,
Milo