In previous chapters, we used a combination of WATCH, MULTI, and EXEC in several
cases to implement a form of transaction in Redis. Generally, when there are few writers
modifying WATCHed data, these transactions complete without significant contention
or retries. But if operations can take several round trips to execute, if contention
is high, or if network latency is high, clients may need to perform many retries in
order to complete operations.
In this section, we’ll revisit our autocomplete example from chapter 6 along with
our marketplace example originally covered in chapter 4 to show how we can simplify
our code and improve performance at the same time.
First up, let’s look at one of our autocomplete examples from chapter 6.
TRY REDIS ENTERPRISE CLOUD FREE
Redis Enterprise Cloud provides complete automation of day-to-day database operations. Start now with 30MB of free storage.
Click on the link we sent you to activate your account and complete your signup process