Just started looking into redis.
Redis is a single-threaded process.
Does this mean all operations (e.g. hset, hget etc) are executed in a serial nature – meaning that e.g. with the following operations:
hset foo:bar name 'Redis'
hget foo:bar name
the hget will only be executed after hset?
Yes a Redis instance is single-threaded, all basic operations are atomic and serialized. With Redis you have concurrency, but no parallelism.
In your example, you have the guarantee the hget will always be executed after the hset.
You also have the guarantee that when you send several queries on a Redis connection, the replies will be returned in the same exact order (i.e. Redis supports protocol pipelining).
Please note it is only true for a given connection to a Redis instance. If the data are sharded over several instances, then multiple connections will be used, and you have no such guarantee between queries sent on different connections.