On Thu, Nov 1, 2012 at 7:56 PM, Josiah Carlson <
josiah....@gmail.com> wrote:
> So a special C-implemented API for interacting with the underlying
> system, as opposed to using the redis.call() interface?
There is no real need to break the interface, but it is possible to
extend it considering we are calling it from Lua in some way.
For example, instead of:
redis.sadd("foo",1,2,3,4,5,...) maybe we could support
redis.sadd("foo",my_array)
Or as proposed before, Lua could have access to a few well-specified
APIs that don't have any sense called as commands, that can operate
keys in very fast ways, as mass-add to list, set, zset, ...
I don't think this will be a big issue, but this is one of those ideas
that in order to enter Redis need 6 months or more and a clear
understanding that we: 1) need more speed compared to Lua loops. 2) We
can't optimize it further. 3) A minimal set of API calls can do a
great difference in some case.
For now I'll simply not add anything :-) We'll need a lot of
experience to understand what's a sensible thing to implement or not
IMHO.
> That seems to me to be rife with "I want internal API X", which is the
> same problem, only now there are 2 APIs (the external and internal).
This is bad only if the second API makes sense as a standard command
itself, this would be odd.
But: mass_add_to_set(key,array) is in the command API simply SADD.
However I think it's much better if mass_add_to_set() can just be an
optimization the user is not aware of at all if possible.
Like if the engine detects "SADD","key", ... many args, it will take a
code path that will add stuff directly to the set instead of really
going along the normal code path to dispatch the command using the
"fake client".
> What about just offering the ability to call 3rd party C extensions
> stored in .so modules via Lua? Combine that with a relatively fixed
> C-API for major components in Redis for major releases, and you
> basically have the Postgres 3rd party situation (which has worked
> great for them).
I'm really against that for a number of reasons already exposed. But
this is a short summary:
1) Every Redis instance should be the same with a set of minimal API.
2) I don't think that external C-coded extensions will allow Redis to
stay as stable as it is today.
3) I think Redis is Redis because of it's API. If everybody can extend
the API Redis will no longer be Redis, in some way.
Cheers,
Salvatore