Starts from the repository you shipped in step 3, Short links, one per customer.
After the merger
A year after the first campaign with a link per customer, Pantry bought Southmart, and the customer list went from 400,000 to two million. From now on every Thursday campaign is two million SMS, each with its own link. In the first minutes about five hundred customers a second open theirs, and almost every one of them is a different link.
That year of Thursdays is in the store: 51 campaigns of 400,000 links, most of them opened once or twice in the two days after their SMS. With this week's, that is 22 million links, and nobody deletes any.
Maya now wants to know when people open: each campaign's openings in every clock hour it was opened in, for this week's and for last year's, so she can pick the hour to send.
The night of 14 May
On 14 May somebody ran a script against the service all night, trying codes at random: 1.3 million requests, every one answered "not found". Sam worked out that with 22 million links and enough nights, some would not be. He wants an IP address that keeps asking for codes that don't exist turned away before it gets lucky, without turning away everybody else.
Where it is measured
You measure on your machine, with the service set up as it runs in production: the year in your store, three copies, five hundred openings a second. Load the year however is fastest, with each weekly link opened 0 to 3 times at hours in the two days after its campaign, and this week's links not opened yet: the campaign tool is not what this step is about. On your public address the limit and the earlier steps are checked, not the load.
Not the job
No accounts for other shops, no deleting old links, no counting the same person across campaigns, and nothing smarter than the limit against scripts.
How the redirect finds a link among 22 million, where the hourly numbers come from and how the copies share the limit are yours to choose. Write the choices down in DESIGN before you build.