Opengist

Explore

  • All gists
  • Topics
  • Users
Give feedback on the new UI Powered by Opengist ⋅ 20ms

user:thomas gists created by user

title:mygist gists with given title

description:sync gists with given description

filename:myfile.txt gists having files with given name

extension:yml gists having files with given extension

language:go gists having files with given language

topic:homelab gists with given topic

all:systemctl search all fields

Login Register
i

interview

Recently created Least recently created Recently updated Least recently updated

linkjobai / System Design Interview: Distributed Locks, Leases and Fencing Tokens

Last active 5 days ago interview

Interview prep notes

0 0 1

System Design Interview: Distributed Locks, Leases and Fencing Tokens

"How would you make sure only one worker processes this job?" is a common follow-up. A good answer covers leases and why a lock alone isn't enough.

The naive Redis lock

SET lock:job42 <random-token> NX PX 30000