Sitemap
5 days ago

Wow, that "simple" task sure got complicated in a hurry. But it makes sense for large systems. Very well-explained, thanks!

One thought: Maybe the Redis parts could be replaed by a HashMap<String,AtomicInteger> to count pending likes. Similarly, for preventing duplicate likes, a HashSet<String> (with synchronization) could hold each user-to-post unique key. I'm pretty sure that would execute a bit faster than a Redis implementation, and elminate the dependency. Redis is fine, but I love to avoid dependencies.

--

--