
Ask HN: How would you design a system with spikes in writes? - aledalgrande
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&#x27;t want to overpay for your cluster when you have low traffic.
======
icedchai
Sharding your DB works if you can figure out how to segment your customers.
Then you just need queue(s) and worker nodes.

~~~
aledalgrande
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

~~~
icedchai
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.

~~~
aledalgrande
Haha did you hack my computer? I was just looking at that :-)

~~~
icedchai
Hah! sounds like you're on the right track. I did some DB sharding/scaling
work at a couple of different startups. Fun times!

