It seems to simplify doing some really cool things, but I'm not sure what those things are...
It seems to simplify doing some really cool things, but I'm not sure what those things are...
I started Webdis because I thought it would be a cool project, after seeing suggestions about such an interface on IRC #redis.
Other that the cool factor, the main benefits are IMO:
* Javascript clients can access your Redis base. This is already done by CouchDB, on a much larger scale. Webdis is nowhere near such capabilities.
* A “Comet” interface to Redis pub/sub commands to stream data using either HTTP chunks (or WebSockets, not implemented yet).
* A way to query your Redis server without having to write code. Point your browser to Webdis and see for yourself if the 12th element in that list is what it should be. Having a public interface doesn't mean you have to expose it to your clients, it can be for internal use.
* A remote access for heavy clients such as Flash or Air. Webdis already serves a crossdomain.xml file for Flash clients; they can query Redis themselves instead of going though a proxy that you'd have to write by hand.
There could be other ways to use it; I'm glad to see the project gain some traction, it will help me figure out what's really important.
Actually that's something i started doing too with Node.Js, an HTTP interface to Redis for my personal use.
At first i did go with a RESTful approach, but you quickly hit the limit of commands available versus the numbers of commands in Redis.
The choice i did was the following:
Read command are accessed through GET this way:
GET http://localhost:8124/get/mykey
200 {"mykey" : "mydata"}
GET http://localhost:8124/hgetall/mykey
200 {"hashKey": {"field1": "value1", "field2": "value2"}}
Write commands are run through PUT or POST :
POST http://localhost:8124/set/key/value
201 {"response": 1}
PUT http://localhost:8124/lpush/myList/1
201 {"response": 1}
Delete commands through DELETE.
DELETE http://localhost:8124/del/mykey 200 {"response": 1}
DELETE http://localhost:8124/hdel/myHash/field
I'm pretty happy with the result, there are some commands i'm not sure where to put though(lpop, rpop, multi, ...)
Also, you can access redis via javascript---client or serverside.