Starts from the repository you shipped in step 2, Short links, at campaign speed.
How many people opened it
In January Maya showed the Christmas numbers: 610,000 openings. Her manager asked how many customers that was, and nobody could say. It could have been 305,000 people opening it twice or 61,000 opening it ten times.
So from now on every SMS carries its customer's own short link, and every link goes to the offers page with that customer's coupon for that campaign in the address, so no address comes up in two campaigns. Before each campaign, Pantry's campaign tool asks your service for 400,000 links, one per customer, in the half hour before the SMS goes out. Each request says which campaign the link is for. The tool runs 100 workers, each waiting for its answer before sending the next, and a request that fails or takes more than ten seconds is tried again, up to three tries in all.
Since a crash in February, Sam from operations runs your service as three copies behind one address, so one of them can go down without the links going with it. All three take requests from the campaign tool at the same time.
What has to hold
A code that belongs to two customers sends one of them to the other's coupon. A code a customer can change by one letter to land on somebody else's link is the same leak, found on purpose. And the campaign tool retries a request that fails or takes too long, so the same address may arrive twice, on two copies at once.
Maya wants one number per campaign: how many of its links were opened at least once.
Three copies and 400,000 links are measured on your machine, with the service set up as it runs in production. Your public deploy runs as many copies as your host gives you, which on a free host may be one.
Not the job
No expiry, no history of when each customer clicked, no limit on how fast someone can try codes, and no new target for the redirect under load.
How codes are made, what the campaign tool's requests look like and how a campaign is read are yours to choose. Write the choices down in DESIGN before you build.