B6What the client asks
“What if it gets busy?”
Caching, read replicas, background work, bounded memory. And knowing which of those you actually need, which is the hard part.
What actually goes wrong
Scaling is four different problems that share a word. A slow report, a thundering herd, a queue that cannot keep up and a process that runs out of memory each need a different answer.
Buying the wrong one is worse than buying none: a cache in front of the wrong query hides the problem and adds a second one.
What Grit does about it
- Caching, background jobs, a queue, read-replica support and bounded batch processing are in the project already.
- Response caching is mounted only where its key is safe, on the public group, and nowhere else.
- Pulse tells you which of the four you are actually facing before you choose.
The commands
Work that must not happen in a request
grit generate job SendInvoiceReminders --cron "0 9 * * *"
What the process is doing under load
grit start# http://localhost:8080/pulse
What it does not do
This is the one the talk marks in a different colour. The tools are here; which one your bottleneck needs stays your call, and anybody who says otherwise is selling something.
