Locks


Memcached

In this tutorial, you will learn how to create and manage a cache and a distributed lock using a Memcached store.

First, we will review the prerequisites. Next, we will demonstrate how to create and perform relevant operations with detailed examples. We will conclude the tutorial with a practical example of using distributed locks.

Memory locks

This tutorial will help you understand how to use the MemoryLock and NullLock components. First, we will see the basic functionality of the MemoryLock class. Then, we will construct an example that will show how to use this type of lock. After this, we will learn what the NullLock is, how it differentiates from the MemoryLock and when to use it. At the end, we will summarize all the concepts learned.

Redis

In this tutorial, you will see how to use two components related to the Redis database. The first is the RedisCache class, which can be used to create distributed caches that store values in Redis. The second is RedisLock, a component that allows us to create a distributed lock based on the Redis database.