On Thu, Nov 1, 2012 at 11:22 AM, Salvatore Sanfilippo <anti...@gmail.com> wrote:
> Hi, you can use Lua Scripting in Redis 2.6 to solve all the scenarios
> you describe.
> I think that while many protocol extensions like this seem natural,
> the risk is to add STORE, then a generic NX option, and so forth, and
> you get with half-a-language that does not benefit in the long run
> IMHO. Instead just going for a Lua script is the simplest thing :-)
> It is much better to provide fast Lua primitives in the future for
> things we'll need. For instance we can have C-coded functions in Lua
> that do things like redis.mass_add_to_set(lua_array) or alike, that
> can avoid writing a loop inside Lua.
So a special C-implemented API for interacting with the underlying
system, as opposed to using the redis.call() interface?
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).
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).