by rand_r · 2y ago · 0 comments
Created a “lock” table with a single string key column, so you can “select key for update” on an arbitrary string key (similar UX to redis lock). I looked at advisory locks, but they don’t work when the lock key needs to be dynamically generated.
I will need a distributed lock soon, but I've never used one before so I'm taking this chance to learn about them.