Command Syntax Confusion

I'm kind of new to REDIS. I use Lists as FiFo Queues most of the time. The use of "L" (Left ) and "R" (Right) in the COMMAND names is confusing ( at least when using queues). I've found some services inside the same system implementing fifo queues with opposite flow directions. And for example the use of RPOPLPUSH did not make sense in some of those services. Now LMOVE should fix that. ( However the first time I was reading about LMOVE I was thinking about "LEFT"MOVE ).

Expert users or solo developers should not have problems with this. But new teams could avoid implementation conflicts.

Perhaps creating some aliases for QUEUE | STACK exclusive commands. For example for FiFo Queues: --->(enqueue) [ L, I, S, T ] -->(dequeue)

  • QADD ( LPUSH ) add to queue
  • QREM ( LPOP ) remove last element from queue
  • QPEEK ( RPOP ) remove first element from queue
  • QMOVE q1 q2 wherefrom whereto ( TOP, BOTtom)

or perhaps the DOCUMENTATION should suggest (standardize) a single approach for most common data structures.

I understand the flexibility of the current commands. But.... Our code is an abstraction of our minds.... Cultures, education and teachers played a huge role when we were understanding the tech world. The way our minds visualize Queues ( or matrixes :D ) is different. Perhaps REDIS could help us with the implementation of Queues.

Comment From: zuiderkwast

I don't think introducing a lot of aliases is a good idea, but some recommendation for queues in the docs would be nice to have IMO.

The page https://redis.io/topics/data-types-intro#redis-lists would be a good place for this. The examples already vaguely indicate that the normal way is LPUSH/RPOP for queues, but I think we can make the recommendation more explicit. It can be updated by a PR to the https://github.com/redis/redis-doc repo.

For stacks (FIFO queues), I suggest we recommend RPUSH/RPOP, since it's slightly more efficient (less memmove).