reporting
The P&L
Whether the event actually made money, computed where the data lives
The reporting layer behind my events business. One screen answers what most event organisers work out afterwards in a spreadsheet, if at all: revenue against supplier costs and sponsor income, how many of the people in the room had been before, and for each marketing campaign, what it cost set against what it actually brought in.
It was originally written the obvious way — pull every paid registration into the application and add it up in code, on every single request. That works until it doesn't, and it gets slower precisely as the business gets busier. So the arithmetic moved into the database, where the data already is, and the application receives finished totals rather than raw rows.
The honest question in any campaign report is what you're allowed to attribute. Originally the only evidence a campaign had worked was how many times its discount code was used — which quietly breaks for any campaign without a code, and for any code that gets shared outside the campaign it belongs to. So attribution is now recorded on the registration itself, at the moment of purchase. Knowing which number you can put in front of someone and which is only directional is most of the work.