nosql - Redis的key按object-type:id:field格式设计的原因??
黄舟
黄舟 2017-04-21 11:17:50
0
1
659

Redis的key按object-type:id:field格式设计的原因??

网上很多人都这么做,还有人明说这可以提升查询效率
但好像没人解释为什么这么做

难道仅仅为了易阅读??

黄舟
黄舟

人生最曼妙的风景,竟是内心的淡定与从容!

reply all(1)
洪涛

This is indeed a design issue.
Let’s not talk about redis first, let’s talk about relational databases first, which are generally based on table design, so they can support various queries, right?
So what should I do with NoSQL in general? Like mongodb's documented storage method, collections are similar to tables in relational databases and can also complete most of the query and indexing work.
What about redis? It is based on key-value. For example, what should you do if you want to query by id or name? The answer is to create an index yourself.
The most basic way is the object-type:id:field you mentioned above. Check student number 01: person:01.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template