Lua soon in Redis

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

Lua soon in Redis

Pierre Chapuis
 Redis (http://redis.io) is going to integrate Lua to let users define
 custom procedures.

 @antirez: the time to try scripting in a Redis branch has come... [1]
 @antirez: I waited to have a more solid idea of the cluster
 architecture,
           but once I'll get some free time I'll create a 'lua' branch
 and try

 [1] http://twitter.com/#!/antirez/status/63266914855694337
 [2] http://twitter.com/#!/antirez/status/63267075438809089

--
 Pierre Chapuis

Reply | Threaded
Open this post in threaded view
|

Re: Lua soon in Redis

Justin Cormack
On Wed, 2011-04-27 at 18:01 +0200, Pierre Chapuis wrote:
> Redis (http://redis.io) is going to integrate Lua to let users define
>  custom procedures.
>
>  @antirez: the time to try scripting in a Redis branch has come... [1]
>  @antirez: I waited to have a more solid idea of the cluster
>  architecture,
>            but once I'll get some free time I'll create a 'lua' branch
>  and try

As far as I am aware this would be the second NoSQL database to
integrate Lua as a scripting language, most of them chose Javascript.
The other one I know of is Kyoto Tyrant which embeds it for complx
operations over the network api http://1978th.net/kyototycoon/luadoc/




Reply | Threaded
Open this post in threaded view
|

Re: Lua soon in Redis

Alexander Gladysh
On Wed, Apr 27, 2011 at 20:26, Justin Cormack
<[hidden email]> wrote:
> On Wed, 2011-04-27 at 18:01 +0200, Pierre Chapuis wrote:
>> Redis (http://redis.io) is going to integrate Lua to let users define
>>  custom procedures.

>>  @antirez: the time to try scripting in a Redis branch has come... [1]
>>  @antirez: I waited to have a more solid idea of the cluster
>>  architecture,
>>            but once I'll get some free time I'll create a 'lua' branch
>>  and try

> As far as I am aware this would be the second NoSQL database to
> integrate Lua as a scripting language, most of them chose Javascript.
> The other one I know of is Kyoto Tyrant which embeds it for complx
> operations over the network api http://1978th.net/kyototycoon/luadoc/

That's actually two different DBs — Kyoto Tycoon and Tokyo Cabinet
(which allows Lua as well, on server-side).

Also, Redis-based Alchemy Database:

http://code.google.com/p/alchemydatabase/

Alexander.

P.S. I suggest that interested members of the community will step up
and participate in the discussion of the Lua integration in the Redis
ML:

http://groups.google.com/group/redis-db/browse_thread/thread/8f32bc241a3a574e

Reply | Threaded
Open this post in threaded view
|

Re: Lua soon in Redis

Alexander Gladysh
In reply to this post by Pierre Chapuis
On Wed, Apr 27, 2011 at 20:01, Pierre Chapuis <[hidden email]> wrote:
> Redis (http://redis.io) is going to integrate Lua to let users define
> custom procedures.

> @antirez: the time to try scripting in a Redis branch has come... [1]
> @antirez: I waited to have a more solid idea of the cluster architecture,
>          but once I'll get some free time I'll create a 'lua' branch and try

See also the blog post:

http://antirez.com/post/redis-and-scripting.html

Alexander.

Reply | Threaded
Open this post in threaded view
|

Re: Lua soon in Redis

Pierre Chapuis
In reply to this post by Alexander Gladysh
 On Wed, 27 Apr 2011 20:31:55 +0400, Alexander Gladysh wrote:

> That's actually two different DBs — Kyoto Tycoon and Tokyo Cabinet
> (which allows Lua as well, on server-side).

 s/Cabinet/Tyrant/g

 Tokyo Cabinet is the low-level library that you can embed in your own
 processes, and AFAIK it has no Lua support. Tyrant is a full-featured
 database system with which you can communicate over a network.

 I know, this duality is confusing :)

> P.S. I suggest that interested members of the community will step up
> and participate in the discussion of the Lua integration in the Redis
> ML:
>
>
> http://groups.google.com/group/redis-db/browse_thread/thread/8f32bc241a3a574e

 +1, especially members of *both* communities!

--
 Pierre Chapuis

Reply | Threaded
Open this post in threaded view
|

Re: Lua soon in Redis

Alexander Gladysh
On Wed, Apr 27, 2011 at 21:01, Pierre Chapuis <[hidden email]> wrote:
> On Wed, 27 Apr 2011 20:31:55 +0400, Alexander Gladysh wrote:

>> That's actually two different DBs — Kyoto Tycoon and Tokyo Cabinet
>> (which allows Lua as well, on server-side).

> s/Cabinet/Tyrant/g
>
> Tokyo Cabinet is the low-level library that you can embed in your own
> processes, and AFAIK it has no Lua support. Tyrant is a full-featured
> database system with which you can communicate over a network.

Yep, sorry, Kyoto Tycoon and Tokyo Tyrant :-)

Alexander.

Reply | Threaded
Open this post in threaded view
|

Re: Lua soon in Redis

Luiz Henrique de Figueiredo
In reply to this post by Pierre Chapuis
> Tokyo Cabinet is the low-level library that you can embed in your own
> processes, and AFAIK it has no Lua support.

There is a Lua binding: http://fallabs.com/tokyocabinet/luadoc/

Reply | Threaded
Open this post in threaded view
|

Re: Lua soon in Redis

Jerome Vuarand
In reply to this post by Justin Cormack
2011/4/27 Justin Cormack <[hidden email]>:
> On Wed, 2011-04-27 at 18:01 +0200, Pierre Chapuis wrote:
>> Redis (http://redis.io) is going to integrate Lua to let users define
>>  custom procedures.
>
> As far as I am aware this would be the second NoSQL database to
> integrate Lua as a scripting language, most of them chose Javascript.
> The other one I know of is Kyoto Tyrant which embeds it for complx
> operations over the network api http://1978th.net/kyototycoon/luadoc/

You can add NoSQL databases with a selectable scripting language to
your list. I've been happily using CouchDB with a Lua backend.

Reply | Threaded
Open this post in threaded view
|

Re: Lua soon in Redis

Pierre Chapuis
 On Thu, 28 Apr 2011 13:54:45 +0200, Jerome Vuarand wrote:

> You can add NoSQL databases with a selectable scripting language to
> your list. I've been happily using CouchDB with a Lua backend.

 Is it Open Source? I know people would be interested in a CouchDB
 View Server in Lua, especially if it uses erlua.

 See http://twitter.com/#!/benoitc/status/62818938169470976 for
 instance...

--
 Pierre Chapuis

Reply | Threaded
Open this post in threaded view
|

Re: Lua soon in Redis

Jerome Vuarand
2011/4/29 Pierre Chapuis <[hidden email]>:
> On Thu, 28 Apr 2011 13:54:45 +0200, Jerome Vuarand wrote:
>
>> You can add NoSQL databases with a selectable scripting language to
>> your list. I've been happily using CouchDB with a Lua backend.
>
> Is it Open Source? I know people would be interested in a CouchDB
> View Server in Lua, especially if it uses erlua.

The code is far from production ready, but feel free to use it in
whatever way you want.

My view server code is roughly based on stuff I found on the Internet.
It's not complete, it's only handling map commands (but that was
enough for my views). It's not hosted anywhere, so I attached it to
this email. For examples of uses, you can see the following script
that injects the view code into my server :

http://hg.piratery.net/movies/src/tip/couchdb-create-design.lua

It uses a CouchDB high level interface in Lua (to be able to use a
database like a big Lua table) with a custom http client library :

http://hg.piratery.net/movies/src/tip/couchdb.lua
http://hg.piratery.net/movies/src/tip/http.lua

viewserver.lua (4K) Download Attachment