As the “Real Bill” answer said, you don't need locks for Radish itself. What the ServiceStack client offers in terms of blocking is not for Redis, but for your application. In a C # application, you can localize locally with lock(obj) so that something cannot happen at the same time (only one thread can access the locked section at a time), but this only works if you have one web server. If you want to prevent something happening at the same time, you need a blocking mechanism that lives outside the web server. Redis is well suited for this.
We have a case when it is checked, if the customer already has a shopping cart, and if not, create it. Between checking and creating it, there is a time when another request could also find that the cart does not exist and can also begin to create it. That classic lock case, but a simple lock , will not work here, as the request may have arrived from a completely different web server. To do this, we use the ServiceStack Redis client (with some abstraction) to block using Redis and allow only one request to enter the "create basket" section.
So, to answer your real question: no, you do not need a lock to get / set values for Redis.
source share