Re:Programmers are not different, they need simple UIs
by jamespedwards on Wednesday May 25, 2016 @01:36PM
(#11771557)
"data structure server" hits the nail on the head. Because Redis is such a paradigm shift from a traditional database, it doesn't matter how simple Redis is, it will always feel complicated if people go into it anticipating a traditional database.
...Some of us don't like Chipotle because it has too many choices, even though we could just order the get/set burrito.
Re:Programmers are not different, they need simple UIs
by catwell on Tuesday May 24, 2016 @05:22PM
(#11765607)
LPUSHX got my attention so I opened a pull request making it variadic (along with other commands) three years ago [1]. Of course since then the codebase changed and it can no longer be merged.
If there is still interest I could try to fix it, although I don't use Redis as much anymore and I have not looked at its code for a long time.
Re:Programmers are not different, they need simple UIs
by antirez on Wednesday May 25, 2016 @03:08AM
(#11768145)
Hey! Yes I'm interested, the PR was not handled for the usual reasons but making the commands variadic is a good idea. However I'm surprised there is not just the need to change the command table since I remembered, incorrectly, all the variants were handled by a single function.
Re:Programmers are not different, they need simple UIs
by catwell on Wednesday May 25, 2016 @03:17AM
(#11768167)
Yeah, as you can see the issue was that it is a different function, pushxGenericCommand(), which is used for LPUSHX, RPUSHX and LINSERT. For me having the same function for LPUSHX / RPUSHX and LINSERT does not make much sense (it uses different code depending on whether or not an argument is NULL anyway) so I had started by making LINSERT not rely on it.
My initial goal at the time was not to make LPUSHX and RPUSHX variadic, since like you said they are not used so much. It was actually to make LINSERT variadic, which can result in a significant performance boost compared to calling it several times.
Anyway, I will try to find the time to adapt it to the current code base.
> Why there is even hyperloglog in a database?
Remember that redis is not really a database but a "data structure server". I have to say I personally don't think this should have been part of the redis core, and it's a textbook example of what redis modules should be, but it came 2-3 years before modules.
> Where did the need for RPUSHLPOP come from?
It came from distributed work queues, which are a popular use case for redis. The documentation actually goes into great detail explaining how to use it.