Idempotent schedule ingestion
A scheduling component that can’t double-book: zero duplicate entries, 85% fewer conflicts.
- Gotel Communication
- Systems Engineer — design and engineering
- 2015 – 2016
- Shipped
- Schedule update
- Content identity
- Distributed lock
- Transactional upsert
- Playout databases
In brief
A broadcast schedule is the backbone of a channel, and network retries were creating duplicate entries in it. I designed the ingestion component for the core programme-scheduling system so the same update can arrive twice — or ten times — and still be recorded once.
For engineers
Python (Django/Flask, Celery) and JavaScript. SHA-256 payload hashing and deterministic UUIDs give each entry an identity derived from its content; Redis distributed locks serialise concurrent writers; PostgreSQL transactional upserts make every write safe to repeat.
Context
Gotel Communication’s programme-scheduling system decides what airs, and when. Downstream playout databases depend on it being right.
Problem
Network retries were creating duplicate schedule entries, and timeslot conflicts were causing scheduling errors.
Approach
Each payload is hashed with SHA-256 and given a deterministic UUID, so a retried message resolves to the same entry.
Redis distributed locks stop concurrent workers writing the same entry at once.
Writes are PostgreSQL transactional upserts: repeating one updates the entry and never duplicates it.
A JavaScript validation interface warns about timeslot collisions in real time, and reconciler daemons keep the playout databases in sync.
Architecture
The components in Fig. 07, in the order a request moves through them:
- Schedule update
- Input · May arrive more than once
- Content identity
- Processing · SHA-256 + deterministic UUID
- Distributed lock
- Guardrail · Redis
- Transactional upsert
- Data · PostgreSQL
- Playout databases
- Output · Kept in sync by reconcilers
Key decisions
Identity from content
If the ID is derived from the payload, a retry can’t create a new record — it can only find the existing one.
Locks for concurrency, upserts for safety
The lock prevents simultaneous writes; the upsert makes any repeated write harmless.
Catch conflicts at entry
Warning schedulers about collisions as they work is cheaper than fixing a conflict after it airs.
Outcome
100%
of duplicate entries eliminated during network retries
85%
fewer scheduling conflict errors
60%
less manual data-entry time
50%
higher ingestion throughput