Consulting engagement
From batch jobs to near-live student data
A new integration layer on Azure replaced batch jobs, so a change in the student system reaches the other systems as it happens.
Case study
Students were being emailed an invitation to an assessment with the link missing. Not always, just often enough to matter. The cause was two automated jobs racing each other.
When a student reached a certain step, two things had to happen in order: a link had to be fetched from an outside provider and saved to the student’s record, and then an email containing that link had to go out.
The first job ran on a timer, checking the database every few seconds for new records. The email was sent by the student system’s own scheduler. Usually the timer won. Sometimes the scheduler did, and the student received a message with an empty space where the link should have been.
Problems like this are miserable to chase. They rarely show up in testing, they cannot be reproduced on demand, and each one is a confused student and a staff member apologizing.
Further down this page, a small simulation runs that race on twelve made-up students, so you can watch it happen.
I replaced the timer with a design that does not wait for one.
The old timed job was not switched off on day one. It stayed in place as a fallback for a trial period, so that if the new path had a problem the student would still be served. The new path was checked in production with a real message before it was trusted.
Within hours of go-live the same timing came up in production, and the new path had the link in place first. Students got their link. The same pattern was then reused for the next integration, which no longer needed to check on a timer either.
If something in your student system “sometimes” goes wrong, suspect timing before you suspect people. Two automated jobs that each work perfectly can still fail together. The fix is to stop one of them waiting on a timer, not to hope the timer wins.
Printed from https://www.datazak.com/work/event-driven-invitations/. An address in parentheses after a link that begins with a slash is a page on https://www.datazak.com.
Watch the race
The race described above is easier to believe when you can see it. Twelve made-up students go through the same two jobs twice: once with the link job on a timer, once with it started by the record being saved. Pick how often the timed job runs late, then run the race.
Made-up records. Student 1001 to 1012 are not real students and nothing is sent. A simplified model that runs in your browser: each tick is a moment, not a real second.
An example run is drawn below. Pick how often the timed job runs late, then run the race.
Job 1 waits for its next timer check, then fetches the link and saves it. Job 2, the email scheduler, sends at tick 6 whether or not the link is there.
Example run: 4 of 12 invitations went out with an empty link.
Saving the record starts job 1 at once, so the link is saved by tick 2 at the latest. Job 2, the same email scheduler, still sends at tick 6 and finds the link already there. Same students, same fetch times.
Example run: 0 of 12 invitations went out with an empty link. The link was saved ahead of the scheduled email each time.
The lesson: the fix is to stop one of them waiting on a timer, not to hope the timer wins.
Each run draws its delays from a small seeded pseudo-random generator (Mulberry32), so a run can be repeated from its seed: Replay shows the same result, and the three presets reuse the same draws, which is why a student who is late at Rarely stays late at Often. Run again picks a new seed. The presets set the share of students whose timed job runs late: about 15 percent, 35 percent and 65 percent. The bars move with CSS transitions whose lengths come from the same numbers, and with reduced motion switched on in your system the end state is shown at once. The script is plain JavaScript with no library: the model is the first few functions, the drawing is the rest.
Consulting engagement
A new integration layer on Azure replaced batch jobs, so a change in the student system reaches the other systems as it happens.
Full-time architect role, then a consulting engagement
A self-service report that lists, classifies and explains every production workflow in the student system, so nobody has to remember what is running.
Consulting engagement
Student documents moved on deadline with zero defects, because every record was verified before sign-off, not a sample.
Tell me what you run and where it hurts. The first call is 30 minutes, free, and you will leave with a clear next step whether or not we work together.