About labeling problems with multi-function modules?

Source: Internet
Author: User
Ask a question, I now multi-functional universal set of tags, articles can have multiple tags, the group has multiple tags, people can also have multiple tags, the topic has multiple tags. Database with MySQL.

The relationship between the previous article and the label is implemented through a mapping table that holds the article ID and tag ID.
Now that there are multiple functions in mind, the table structure should be a tagsmap mapping table, and then distinguish it with field identifiers.

or create multiple mapping tables like Tagsmap_article, Tagsmap_topic,tagsmap_group?

What kind of a better way?

The amount of later data may be much higher.

Reply content:

Ask a question, I now multi-functional universal set of tags, articles can have multiple tags, the group has multiple tags, people can also have multiple tags, the topic has multiple tags. Database with MySQL.

The relationship between the previous article and the label is implemented through a mapping table that holds the article ID and tag ID.
Now that there are multiple functions in mind, the table structure should be a tagsmap mapping table, and then distinguish it with field identifiers.

or create multiple mapping tables like Tagsmap_article, Tagsmap_topic,tagsmap_group?

What kind of a better way?

The amount of later data may be much higher.

Initial proposal or just in a table, add a Type field to distinguish the three categories, the structure is simple and clear, the table is a lot of chaos.
After a large amount of millions of data, and then consider the table can be divided into

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