thought
Using goroutines to boost a marketing broadcast campaign
First published on medium.com ↗
At Sorabel I owned the services on the hot path: coupons, orders, the product catalogue, and the chat platform. One of the slowest things we did every week was the marketing broadcast, a job that pushed a campaign message to a very large list of customers one call at a time.
The fix was not clever. It was Go doing what Go is good at. I split the list into chunks, gave each chunk to a goroutine, and sent bigger payloads per request instead of one message per call. The broadcast that used to take most of a morning finished nine times faster, and the upstream API was happier because it received fewer, fuller requests.
The lesson I kept is about batching, not concurrency. Concurrency made it fast; batching made it kind to the system on the other side. I wrote the full version, with code, for the Sale Stock engineering blog on Medium.