1 BADGE. 50 OFFICES.HOW DOES THE DOOR OPEN?
System design of an office ID card swipe
Step 1
Watch
Step 2
Read
1. The tap
You tap your badge, the reader beeps, and the door unlocks in about half a second. That half second crosses three layers of a distributed system.
2. One door: the reader is dumb, the controller decides
The badge carries an RFID chip (usually 13.56 MHz) holding a card ID; modern cards protect it with encryption so it can't simply be cloned. The reader does almost nothing: it reads the ID and passes it down a wire, over the older Wiegand protocol or the newer, encrypted OSDP, to a door controller mounted nearby.
The controller holds a local access list: which card IDs may open this door, and when. It checks the ID, and if it's allowed, fires the relay on the lock. No network call happens on the critical path.
That is an edge decision: the choice is made at the device closest to the action.
3. One building: rules down, events up
A building has dozens or hundreds of doors, grouped under controllers on each floor. Above them sits the PACS (Physical Access Control System) server.
The flow runs both ways:
- Rules flow down. The server pushes each controller the slice of the access list it needs.
- Events flow up. Every swipe, denial, door-held-open and forced-door alarm streams back to the server for audit and the security desk.
If the server goes down, the doors don't notice. Each controller keeps working from its cached rules and buffers events until the server returns. That's offline-first: design the edge to survive the loss of the center.
4. Joiners and leavers
Nobody types badge rules by hand at scale. Access follows identity:
- HR creates the employee record (the source of truth).
- The identity system (directory plus roles) syncs the person and their roles.
- PACS maps roles to door groups and pushes the rules to controllers.
When someone resigns, the same chain runs in reverse: a revoke reaches every controller within seconds, and the badge is dead everywhere. This lifecycle (Joiner, Mover, Leaver) is called JML provisioning.
5. Fifty offices across three continents
One global server for every door would be slow and fragile: a WAN blip in London would lock people out of the Bengaluru office.
Instead, each region runs its own PACS server, and doors and decisions stay local. A central identity hub holds only what every region needs: who a person is and where they may go. That data replicates outward, while door events stay regional.
If the WAN link to one region drops, that office keeps running untouched. This topology is hub & spoke.
6. The lesson
Decide at the edge. Control from the center. The door never waits for the server, and the server still sees every door. You'll find the same pattern in CDNs, payment terminals, IoT fleets and mobile apps that work offline.
Step 3
Key terms
This is called
Edge decision
Making the decision at the device closest to the action (the door controller) instead of asking a central server every time.
This is called
Offline-first
Designing a component to keep working from locally cached data when the network or server is down, and to sync when it comes back.
This is called
JML provisioning
Joiner–Mover–Leaver, the identity lifecycle that grants, changes and revokes access automatically from HR events.
This is called
Hub & Spoke
A topology where regional sites run independently and a central hub shares only what all of them need, here identity.
This is called
PACS
Physical Access Control System, the server software that stores badge rules, pushes them to controllers and collects door events.
This is called
OSDP
Open Supervised Device Protocol, the encrypted, two-way standard for reader-to-controller wiring that replaces the older Wiegand.
Step 4
Check yourself
Step 5
Practice
Design badge access for a 500-bed hospital: ICUs and pharmacy need two-factor entry, fire alarms must unlock exit doors, and staff rotate between three campuses weekly.
Hints (3)
- What should a door do when the fire panel trips, and who decides: the controller or the server?
- Where does the second factor (PIN, biometric) get verified without adding a network round trip?
- Rotating staff is a 'mover' event. How fast must access follow the roster, and what's your source of truth?
Model answer outline
- Controllers stay the decision point; add PIN/biometric readers on ICU and pharmacy doors and verify the template locally on the controller.
- Wire the fire panel to controllers through a hard input so exit doors fail-safe (unlock) even if every server is down; perimeter doors fail-secure.
- Drive campus access from the rostering system as JML 'mover' events: grant the next week's campus ahead of time, revoke the old one after the shift, and audit both.
- One PACS per campus, plus a shared identity hub; replicate identity and roles, never door events, across campuses.
- Stream events to a central SIEM for anti-passback alerts and audit; keep the alerting off the critical door path.