Hi, I have already showed my project here but now I introduced a pretty big new feature. Now you can follow any user/channel/thread and the latest 5 posts from your follow will appear on your personal wall on the homepage.<p>You might ask why only 5? Turns out personal wall is not as easy to solve without significant time investment if you want to keep it performant too. Simply naively aggregating posts would be costly on database and wouldn't scale for sure and potentially wouldn't even perform on small scale. Some smart architecture with smart caching for each user wall seemed complicated for that project that is already too big for one person. But then I thought of using things I already use - mongodb and meteor.js.
My architecture is quite simple: there are tracker doc collection where document contain 5(or X) latest posts in an array and every-time something is posted this tracker is updated. Then there is userFollows collection with docs to connect users with trackers. From there I allow meteor.js to handle the rest. Once it subscribes to trackers that user follows all the posts of those trackers are shown on the front page with the added advantage that any new post if transferred right away because of meteor's reactivity so front page is "real time". I also use redis-oplog package for meteor which caches collections server side and made this pretty performant and very easy to implement. It's not ideal but hopefully it will be good enough.