Article tags Tag store

Source: Internet
Author: User
Want to ask, Segmentfault's question label is how to store the design, because we also have this demand, looked up the information, if the simple use of MySQL storage, Too cumbersome. I think it is possible to store multiple tags in the form of an array in MongoDB, the ID of the MySQL storage tag, because we need user input tag auto prompt, and MongoDB just can use regular expression query tag, but MongoDB is looking not to go index, so efficiency does not know how?

Reply content:

Want to ask, Segmentfault's question label is how to store the design, because we also have this demand, looked up the information, if the simple use of MySQL storage, Too cumbersome. I think it is possible to store multiple tags in the form of an array in MongoDB, the ID of the MySQL storage tag, because we need user input tag auto prompt, and MongoDB just can use regular expression query tag, but MongoDB is looking not to go index, so efficiency does not know how?

Spend 4 hours to read Http://t.cn/RArNl90 confirm the selection right, see tags This is why I jumped out of the always redis it

No, the label storage is very simple, 2 tables can be solved ah, with MySQL, a label table, a relational table, it is OK, and later maintenance is easy to update. You're making the problem complicated.

In their own development of the long AI network, the idea is this: in the table to store the article has a category field, used to store the article tags, of course, an article may have a number of tags. After getting to tags, if an article has two or more tags, I will split it, split into a single, stored in the tags table. Of course will be judged, if tags in the table already exist, just increase the number of tags, if not, then insert a new record.

Or use a decision to use Redis.

  • 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.