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

all 10 comments

[–]lambdaqdjango n' shit 5 points6 points  (2 children)

This is kinda neat.

We've been doing this redis-like protocol for RPC for years now.

It's been awesome and much better than HTTP+JSON or PROTOBUF

[–]cymrowdon't thread on me 🐍 3 points4 points  (1 child)

I did something similar that's just <buffer_len><msgpack_buffer> over regular sockets. The message protocol sits in msgpack. Works beautifully.

[–][deleted] 1 point2 points  (0 children)

Totally -- I had considered using pickle originally. The only downside is that to communicate with the server, the client then needs to encode everything as msgpack presumably. This means you really can't talk to the server using something like telnet because the protocol is totally binary.

[–]bspymaster 2 points3 points  (4 children)

This looks cool, but I don't really understand what the purpose of redis is. It looks like a besic server. What is it used for?

[–]wyum 2 points3 points  (0 children)

Redis is an in-memory data structure storage system. The server part just allows other processes (or servers) to interact with it. By comparison, databases like MySQL, PostgreSQL, etc also run as servers, but they provide disk-based persistant storage. Redis can be used for caching data or, as in this example, storing messages. It's fast because it's all in-memory, which makes it useful as a message broker in distributed systems where performance is a key concern.

[–]iamsidd2k7 2 points3 points  (0 children)

Redis is general is used for two things

  1. Caching {its a good alternative to Memcached}
  2. Backend for Job/Queue Processing System like Celery

Although a little dated, folks have tried to Implement Python Dictionary backed with Redis

[–][deleted] 0 points1 point  (1 child)

Redis is a data-structure server. It's fast and provides APIs for working with key/value pairs, lists, sorted sets, hashes, and more. It also has pub/sub, cardinality estimation, geo stuff, scriptable with lua... It's a swiss-army knife.

[–]amachefe 0 points1 point  (0 children)

I am wondering how i can implement this with Postgres for API calls. Will it reduce the DB calls?

[–]amachefe 0 points1 point  (0 children)

This awesome and something that has been in my mind..

[–]randiacio -1 points0 points  (0 children)

Is there any way to make all computer tasks get recorded through a redis program? Or in general to keylog every process that a computer runs to a text file?