M
M
Michael2016-09-02 02:11:16
Redis
Michael, 2016-09-02 02:11:16

Is it justifiable to use Redis for something like this?

Hello. You need to write a telegram bot that sequentially asks the user questions, and then writes the entered data to the database. Before the survey, the user will have to select a language. I decided to connect Redis for this.
That is, with each message, I will read from Redis the so-called "level" (that is, what question the user is on) and the language chosen by him. All answers will also be written to Redis, and then entered into the database. So the question is:
Is it correct to use Redis for this? Maybe I will win in speed if I just store an array of objects (well, or a JSON file)
PS Bot implementation on Node.js

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
napa3um, 2016-09-02
@mak_ufo

You, in fact, implement the storage of user session data. Using redis for this is quite a common and common practice.
PS: it is better to try to win something in performance only after it has been lost in practice, the so-called "premature optimization" (solving non-existent problems) is a very common psychosis among novice developers.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question