Pregunta

I'm writing a C# application that interfaces with REDIS (via a C# REDIS client interface, such as ServiceStack / BookSleeve).

I'm looking for advice in how to most efficiently multi-save two concurrent lists of keys & values into co-ordinated sets. Some of the keys will be duplicated, at which point I want to simply add the corresponding value to the set. The MSET command allows for adding multiple key / value pairs, but I'm targeting sets containing the values.

My research so far has pointed me at pipelining multiple SADD commands for each distinct grouping of keys & values, but I was curious if there was a more efficient method.

¿Fue útil?

Solución

I've settled for mapping the lists into a Dictionary<string, List<string>> (key being the set name) and pipelining SADD commands.

Any further suggestions very welcome.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top