3 ms·
Ask HN: How would you design a system with spikes in writes?
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.
- icedchai 7y agoSharding your DB works if you can figure out how to segment your customers. Then you just need queue(s) and worker nodes.
- aledalgrande 7y agoCan 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 7y agoIt'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 7y agoHaha did you hack my computer? I was just looking at that :-)
- icedchai 7y agoHah! sounds like you're on the right track. I did some DB sharding/scaling work at a couple of different startups. Fun times!