D
D
developer0072017-01-23 22:28:15
MySQL
developer007, 2017-01-23 22:28:15

When to use - redis or memory in mysql?

1) When would you use redis to store cache data (or not cache), and when would storage engine = MEMORY (in MySQL) ?
----
2) there is another curious crutch - InnoDB on RAMdisk , who thinks about this?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
E
Eugene Wolf, 2017-01-23
@developer007

In which cases would you use redis to store cache data (or not cache), and in which storage engine = MEMORY
Personally, I - probably in all cases in which Redis is suitable for this. Partly due to the fact that projects that require caching of this level are mainly (* specifically in my practice, in fact - this does not mean anything) are completed with Postgres.
Among other advantages - radish can save data and disk, this may be important / necessary.
In other cases, the main thing is to do it without fanaticism. There is no "one-size-fits-all" solution that would give a 100% result. You have certain requirements for the task, there is a tool. If MEMORY_ENGINE works fine (i.e. you are satisfied with the indicators), and you already have MySQL installed and it works - why drag more Redis? This will complicate the system, although not much.
If you do not have MySQL, or MEMORY_ENGINE for some reason did not suit you, for example, you need to save data to disk or [reason-N] - take Redis.
Also, it is worth noting that the functionality of MEMORY_ENGINE is a little wider, in view of the presence of a full-fledged SQL engine, and in general is logically different from a radish.
And then there's Memcached...
2) there is another curious crutch - InnoDB on RAMdisk , who thinks about this?
In my opinion, the decision level "so-so". I don't like this idiom.
Yes, and in general - Redis is exactly a cache storage, with a cache lifetime out of the box (as an example), MEMORY_ENGINE is a full-fledged table, with all the ensuing facts. The functionality, as I wrote above, is a bit different...
PS In MySQL, I remember, they threatened to introduce some new engine, just in order to "outshine" all Redis with Memcached together, but something then I do not find information about this ... but I remember exactly that I read this!

Y
Yuri, 2017-01-24
@riky

redis is probably faster.
memory mysql - you can work not only as a key-value, but also make different selections / sorting / grouping, etc.
radish also has some data structures besides key-value, but others, far from those that relational databases provide (they still need to be studied and used to).
so the choice is either simplicity and speed or sql functionality.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question