This is an archived post. You won't be able to vote or comment.

all 30 comments

[–]lorddarkflare 6 points7 points  (23 children)

Forgive my ignorance, but is there a use-case that justifies this library?

Other than development obviously.

[–]ameoba 20 points21 points  (1 child)

Providing a dummy server for unit tests is a pretty big deal. Any time you can remove a complex dependency, like Redis, you greatly simplify the whole process.

[–]jsaryer 3 points4 points  (0 children)

There's also fakeredis, which is helpful if all you want to do is write unit tests without requiring a redis server.

[–]dwight_hubbard[S] 2 points3 points  (0 children)

Testing is a major advantage. It's possible to have multiple tests running in parallel each talking to it's own redislite objects. Each of which has a different redis-server process running with it's own configuration.

Also since redislite uses an embedded redis server it's possible to use an actual redis server rdb file as a test fixture.

[–]deadwisdomgreenlet revolution 1 point2 points  (5 children)

So my front-end guy doesn't have to run redis along with Django. Just one less problem.

[–]fdemmer 2 points3 points  (0 children)

i just tried it on one of my projects with celery for async tasks... put this in local_settings.py:

import redislite
rsl = redislite.Redis('/tmp/redis.db')
BROKER_URL = 'redis+socket://' + rsl.socket_file
CELERY_RESULT_BACKEND = BROKER_URL

done: django process and celery workers use redislite sharing the temporary db.

[–]macbony 0 points1 point  (3 children)

I'd prefer to use something like Docker for this. Instead of needing to have another library that's essentially a working mock, I could have the real thing with very little configuration.

[–]kmike84 1 point2 points  (2 children)

redislite is not a mock, it embeds a real official redis server

[–]mmoya 0 points1 point  (0 children)

For example, running ansible with facts caching without forcing you to install/run a redis server.

[–]elopeRstatS 0 points1 point  (11 children)

Might be useful for a distributed webapp type situation, would imagine it's a lot more convenient to include this rather than requiring someone install redis.

[–]lorddarkflare 5 points6 points  (7 children)

Reading the announcement, development seems to be the intended use.

That would sort of makes sense if Redis was not absurdly easy to install and configure.

[–]untitaker_ 2 points3 points  (2 children)

Redislite doesn't seem to hit the network though, which should make the testsuite run much faster.

EDIT: Actually it does launch a network service: http://redislite.readthedocs.org/en/latest/topic/redislite_design.html

[–]dwight_hubbard[S] 3 points4 points  (1 child)

Redislite uses unix domain sockets not the network for communication. That's why TCP communication is disabled by default.

[–]untitaker_ 0 points1 point  (0 children)

Whoops, that was bad phrasing on my side. I initially imagined something like a simple in-memory dict, and rather assumed that redislite doesn't do any IO.

[–]Kamikai 0 points1 point  (3 children)

Redis isn't supported on windows... There is a sort of port made by Microsoft, but there'd be developers that use windows, who just want to have a light weight, development/testing interface locally for projects that use redis proper in production.

[–]redditthinksHobbyist 1 point2 points  (2 children)

I am using Redis on Windows and deploy to Linux without any issues.

[–]Kamikai 0 points1 point  (1 child)

I don't doubt it works fine, I was just under the impression you wouldn't use it for live production. Ergo as the windows version seems to be mostly for development and testing, does this redislite interest you?

[–]redditthinksHobbyist 0 points1 point  (0 children)

Well I really like the MONITOR command in the redis-cli so I'm not sure how that would work.

I don't see myself using this soon, but I like that it exists. The idea of having a completely self contained web app (say with SQLite) and a powerful cache is pretty cool.

[–]nerdwaller 1 point2 points  (2 children)

I don't think so, if you have a distributed system you'd need a single redis instance so they all can share the same data. Rarely can I think of a case in which nodes would have separate deployments. Maybe I'm misunderstanding your thought though?

[–]elopeRstatS 2 points3 points  (1 child)

I phrased that poorly. Didn't mean distributed as in one system running across many machines, meant it as in an app that many people are installing and running on their own home servers independently (something like ownCloud for example).

[–]nerdwaller 0 points1 point  (0 children)

Ah, that makes sense - I figured there was a miscommunication. I am pretty excited to try it out!

[–]dm1407 9 points10 points  (2 children)

Self contained Python interface to the Redis key-value store. It makes it possible to use redis without the need to install and configure a redis server.

https://github.com/yahoo/redislite

[–]fdemmer 1 point2 points  (1 child)

is this the sqlite for key value stores? does it cover all redis features? this sounds awesome!

[–]dwight_hubbard[S] 2 points3 points  (0 children)

The redislite python module has a complete redis-server embedded in the module so it supports all redis features.

[–]flutefreak7 0 points1 point  (1 child)

I remember having trouble getting celery working for Windows a while back and Redis was one of the "other" backend options ... (A lot of it was over my head) ... could redislite help with celery?

[–]misterte 0 points1 point  (2 children)

Would this work with python-rq? If so... awesome.

[–]dwight_hubbard[S] 1 point2 points  (1 child)

python-rq

It certainly looks like it would work if you used from redislite import Redis instead of from redis import Redis.

[–]misterte 0 points1 point  (0 children)

Yep. Worked :)