2

I'm wondering is there any good resource with a clear explanation of how like/dislike buttons are actually implemented in modern distributed systems like Instagram/Twitter?

I.e. we can assume that such metadata (name, size, resolution, likes/dislikes) is stored in RDBMS.

How to make it faster without the necessity of instant SQL insert on every like?

Maybe we can put this info into the cache and then start a background thread for the actual insert? Following the "write-back" cache type

Developer87
  • 2,448
  • 4
  • 23
  • 43

1 Answers1

1

Maybe we can put this info into the cache and then start a background thread for the actual insert? Following the "write-back" cache type

Mysql already has built-in memcached integration. Just add, set, or incr your key value pair and it will get stored to an innodb table eventually.

https://dev.mysql.com/doc/refman/5.6/en/innodb-memcached.html

Other than that, your question is too broad and the answers are too opinionated. Just update SQL until you can't do that anymore, then do some kind cached access / eventual consistency until you can't do that any more. Then federate or shard your cached access / eventual consistency solution.

chugadie
  • 2,786
  • 1
  • 24
  • 33