I’ve read in a couple places that Redis is idempotent, so a repeated call to SetEntryInHash() will have no effect, right?
Is there any good case for using SetEntryInHashIfNotExists()? Can this give quicker results than just blindly calling SetEntryInHash()?
Idempotent means you can replay the same action multiple times and it will have the same side-effect. Only idempotent operations like SADD are idempotent, i.e. after calling that 1 or more than 1 times you will end up with the same result, i.e. a single item in the set.
Adding to a redis list, e.g. LINSERT is by contrast not idempotent as every new item adds a new item to the redis list.
If you want to know how operations in ServiceStack’s Redis Client are implemented, just inspect the source code. SetEntryInHash and SetEntryInHashIfNotExists are here. They both call HSET and HSETNX respectively. Refer to the documentation in redis to learn about the behavior of each operation.