Superficially this works well, but there is a problem: this is a single point of failure in our architecture. When the client needs to release the resource, it deletes the key. The key is usually created with a limited time to live, using the Redis expires feature, so that eventually it will get released (property 2 in our list). The simplest way to use Redis to lock a resource is to create a key in an instance. To understand what we want to improve, let’s analyze the current state of affairs with most Redis-based distributed lock libraries. Why Failover-based Implementations Are Not Enough As long as the majority of Redis nodes are up, clients are able to acquire and release locks. Eventually it is always possible to acquire a lock, even if the client that locked a resource crashes or gets partitioned. At any given moment, only one client can hold a lock. We are going to model our design with just three properties that, from our point of view, are the minimum guarantees needed to use distributed locks in an effective way. Includes async and lock extension support. NET implementation with configurable datastore).
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |