How Redis stores multiple fields and makes it easy to find

Source: Internet
Author: User
I want to save a data like this

mail                 valueabc@xxx.com          val_1bcd@xxx.com          val_2cde@xxx.com          val_3def@xxx.com          val_4

Now I need to find the value of cde@xxx.com in Mail

What should I do with Redis?

Reply content:

I want to save a data like this

mail                 valueabc@xxx.com          val_1bcd@xxx.com          val_2cde@xxx.com          val_3def@xxx.com          val_4

Now I need to find the value of cde@xxx.com in Mail

What should I do with Redis?

Set mail:abc@xxx.com:value val_1Set mail:bcd@xxx.com:value val_2Set mail:cde@xxx.com:value val_3Set mail:def@xxx.com:value val_4

Come out of the idea of a relational database ~

Named in a certain format, as in the case of Icode

Hset mails abc@xxx.com Val1

Hset mails bcd@xxx.com Val2

  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.