Each *individual* command is guaranteed to be atomic, but groups of commands are only atomic if you use a transaction. In the case of LPUSH/TRIM to maintain a fixed-size scrolling list, that shouldn't be necessary *if* you don't mind occasionally getting a few extra items, i.e. if you have
conn1: LPUSH LTRIM
conn2: LPUSH LTRIM
conn3: LRANGE
you *could* get that processed as:
conn1: LPUSH
conn2: LPUSH
conn3: LRANGE (returns n+2 items if you say "everything")
conn2: LTRIM (removes 2 extra items instead of the 1 you might normally expect)
conn1: LTRIM (removes nothing)
of course, you can "fix" this by simply specifying the correct limits on LRANGE.
Does that make sense? have I misunderstood the question?
Marc
Hello, I want to ask about the atomic operations in redis. Where to read something that all operations in redis atomic, is this true? Example: I have a new type of list, and from it selected the first 10 lines of command LRANGE overwriting the team LPUSH and LTRIM. So if there will be 2 simultaneous connections of users that normally do перезапишется this list, that is 1 user to overwrite this list and then 2 the user to overwrite. And another question, what if-in-1 hash store about 5 million of the fields?