Domanda

I generate lot of messages for sending to client (push notifications using push woosh). I collect messages for a period of time and the send a bucket of messages. Need advice, what is the best to use for queue python list ( I am afraid to store in memory lot of messages and to lose if server restarts), Redis or MySQL ?

È stato utile?

Soluzione

Redis can save the data contained in memory on your hard drive, so you don't have to be worried about to lose informations. And you can add a key expiration to your data saved in memory, so you can remove old messages.

Have a look here :

http://redis.io/topics/persistence

And here :

http://redis.io/commands/expire

Altri suggerimenti

I don't know what is the best from MySQL or Redis to process message queues since I don't know Redis.

But I could tell, MySQL is not designed for that purpose.

You should take a look at dedicated tools such as RabitMQ that will probably serve better your purpose. Here is a basic tutorial (incl. Python): http://www.rabbitmq.com/tutorials/tutorial-one-python.html

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top