I’m trying Unique Index implemantation with Redis db (ServiceStack Client)
Normally
- Check Unique Index Duplication
- If Unique Index Exists RETURN WITH WARNING
- WATCH for Unique Index (for race-condition)
- Open Transaction
- Insert new record, Insert new records unique index
- Close Transaction
How can I get rid of 1st step?
WATCH for existence. I’m not related with changing of key. I’m related with creation or existance. (surely out of my transaction)
If you are trying to use redis just for checking duplicated then use hashset:
http://redis.io/commands#hash
how do you use the servicestack client? with native client? typed client? (then i can show you how to do that)
and use that command: http://redis.io/commands/hsetnx