Answer the question
In order to leave comments, you need to log in
How to properly migrate table structures to redis?
Tell me how to properly organize the storage structure in redis.
For example, now there is such a table in the mysql database
_________________
| id | author |
-------------------
| 1 | ivan |
-------------------
______________________
| id | author_id | text |
-------------------------
| 1 | 1 | bla |
Answer the question
In order to leave comments, you need to log in
Alternatively, you can make two sets - authors and publications - to store the keys. And by key, store the content, for example, in json format.
SET author1 '{"name":"ivan"}'
SET publication1 '{"author_id":"author1","text":"bla"}'
SADD authors 'author1'
SADD publications_author1 'publication1'
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question