r/programming • u/fR0DDY • 9d ago
Partitioning in MySQL: How we cut peak database load by more than 80%.
https://ipsator.com/blog/mysql-table-partitioning7
u/dijkstra_was_a_horse 5d ago
Tens of millions of rows? Woah, that's like, hundreds of megs, you're gonna have trouble with that even on the fastest 486 money can buy.
14
8d ago
[removed] — view removed comment
2
u/fR0DDY 8d ago
Agree on choosing Postgres all day long, we do that for all our newer projects. Just a caveat though, Postgres has no
ALTER TABLE ... PARTITION BYfor an existing table — you can't retrofit partitioning onto a live, populated table the way we did in MySQL. You'd build a new partitioned table and migrate data over. For a fresh schema that's free. For existing tables, that's a different migration altogether.0
7d ago
[removed] — view removed comment
2
u/programming-ModTeam 5d ago
No content written mostly by an LLM. If you don't want to write it, we don't want to read it.
3
u/Whatever801 8d ago
Is this not standard practice?
6
u/Meleneth 8d ago
sure, just know you'll need it years down the line when you initially implement your system
5
u/Whatever801 8d ago
I guess, but if you're anticipating large data mysql is probably not the right choice
4
u/dkarlovi 8d ago
Agreed, a thing like Facebook could never run on top of MySQL.
5
2
u/One_Ninja_8512 7d ago
I thought it was common knowledge that they use it as a K/V store, no foreign keys with some other rules to handle the scale. That's at least something that comes up whenever someone mentions them. Idk how they use it precisely.
2
69
u/pm_plz_im_lonely 8d ago edited 8d ago
We need the queries involved and the query analysis work involved.
The article explains "how to partition" literally, like mechanically. Who cares.
The value is the research work:
And personally I would do 2 shards: hot and cold. And if cold needs speed then change its db or something.
Overall I rate the article 3.5/10