unite SCARD and LLEN

14 views
Skip to first unread message

Birukoff

unread,
Oct 28, 2009, 12:12:50 PM10/28/09
to Redis DB
I think these two command should be united as 'LEN'. There is nothing
in them or in the underlying data types that makes the current
distinction somehow useful.

Salvatore Sanfilippo

unread,
Oct 28, 2009, 12:23:50 PM10/28/09
to redi...@googlegroups.com

Hello birukoff,

but then LEN should also be able to tell the total bytes into a string
value right?
So you end with LEN being a polymorphic version of:

LLEN, SCARD, ZCARD, STRLEN (that currently does not exist)

This appears to be nice if you think at it as a programming language.
With a database what happens is that for a bug you can LEN against a
type you think it's a Set, but for some inconsistency in the dataset
it's actually a String or a List. The program instead to stop
continues to run corrupting the dataset even more.

In calling the right command for the right type there is a bit more
information associated with the command, that will prevent some bug,
and will make the programs more obvious to read.

Cheers,
Salvatore

--
Salvatore 'antirez' Sanfilippo
http://invece.org

"Once you have something that grows faster than education grows,
you’re always going to get a pop culture.", Alan Kay

Reply all
Reply to author
Forward
0 new messages