Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
How to do distributed locking (2016) (kleppmann.com)
15 points by mooreds on July 16, 2022 | hide | past | favorite | 3 comments


(how to do distributed locking on top of Redis)


Fencing tokens might be fine to prevent data corruption but they don't suffice to guarantee mutual exclusion.

For instance, if you need to deal with an external API and you need to avoid the same request going out twice and you have logic that could in theory lead to that, e.g. via concurrent retry mechanisms, at least once semantics, etc.

What's the solution for ensuring code execution under mutual exclusion in a distributed system?


Don't these APIs typically have an idempotency key or similar so you can send the same request multiple times safely?




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: