4 ms·
Ask HN: How do you scale MySQL (or Postgres) writes?
I have been reading about scaling relational databses, and so far most of what I have seen caters to key value style reads(caching by the primary key). I am still curious to understand how do people scale their MySQL writes. I would love it if some of you could share what you did.
- tdbgamer 9y agoScaling reads is pretty easy with MySQL as you can create read replicas and just have a single write node. Scaling writes while maintaining strong consistency is very hard and requires a sharding setup. Facebook wrote an article showing a bit under the hood details of how they setup MySQL sharding here: https://www.facebook.com/notes/facebook-engineering/under-the-hood-mysql-pool-scanner-mps/10151750529723920/ https://www.facebook.com/notes/facebook-engineering/under-th... You should look into CockroachDB if you want something very easy and scalable. It's strongly consistent like a conventional RDBMS but still scales horizontally pretty easily. It's basically like Google Cloud Spanner if you've heard of that.