Ask HN: How would you design a system with spikes in writes?

2 points by aledalgrande ↗ HN
Spikes in reads are more or less handled with cascading levels of caching, but what about writes? Horizontally scaling a database is not something that is done easily without integrity problems, but you don't want to overpay for your cluster when you have low traffic.

5 comments

[ 4.8 ms ] story [ 22.3 ms ] thread
Sharding your DB works if you can figure out how to segment your customers. Then you just need queue(s) and worker nodes.
Can I scale up and down my sharding on demand though?

Edit: I guess it's not always important to have all the writes happen in real time, so you'd get away even with a growing queue

It's not really simple to do that sort of DB scaling on demand. You might want to look into a service like Amazon's Aurora which I believe has that capability.
Haha did you hack my computer? I was just looking at that :-)
Hah! sounds like you're on the right track. I did some DB sharding/scaling work at a couple of different startups. Fun times!