3 ms·
Similar to litements litecache is DiskCache[0]. It is a pure python Redis/Memcached alternative which is faster than them for reads. Under the hood it uses shar
by Anonymous4272 5y ago
Similar to litements litecache is DiskCache[0]. It is a pure python Redis/Memcached alternative which is faster than them for reads. Under the hood it uses shared Sqlite.
[0] https://github.com/grantjenks/python-diskcache https://github.com/grantjenks/python-diskcache
- polyrand 5y agoYes, I’m aware of DiskCache. Wonderful library and also very useful, I enjoyed reading the source code too. I have taken a few ideas from it that I would like to implement in the future.
- avinassh 5y agoThis is quite interesting! How can be a disk based cache be faster than redis? (They claim this on their Github page)
- polyrand 5y agoI would say: 1. No network round trips 2. SQLite runs in the same process as your app, so reading from SQLite is basically like calling a function in your program (from a performance point of view).
- avinassh 5y agoI checked the benchmarks page [0], they run the Redis in same machine. And also, running Redis in different machine and connecting over networking isn't same compared to using diskcache. > SQLite runs in the same process as your app, so reading from SQLite is basically like calling a function in your program But SQLlite needs to write to disk, which will be much costly. [0] - http://www.grantjenks.com/docs/diskcache/cache-benchmarks.html http://www.grantjenks.com/docs/diskcache/cache-benchmarks.ht...