V
V
Voldemar Duletsky2015-02-08 02:21:58
Redis
Voldemar Duletsky, 2015-02-08 02:21:58

Is it reasonable to store logs in redis?

There is an API and it is necessary to record all API requests grouped by user_id. Now I am writing everything to radishes, but as it turned out, this is not an optimal log storage, since when the RAM under redis runs out, difficulties with writing / reading to radishes may begin. Is it so?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
@
@mgyk, 2015-02-08
_

Yes, that's right, radish stores everything in memory, although it synchronizes to disk. Writing logs there is a bad idea. If using LIST, do LTRIM at least to clean up old logs and keep the last N entries. But it's better to transfer somewhere in logstash.net , for example

D
Dan Ivanov, 2015-02-08
@ptchol

If the data is of an analytical nature, with "natural" indexes, then try looking at the mongo capped collection. The data itself will be "cleaned", and at the same time it is a quick access to the latest data.

E
Eugene, 2017-09-24
@mUchenik

I think it will help

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question