The idea of database keeping record
Now the site has an activity information, each activity can have a lot of users to participate, now there are two ways to save the ID of the participating users,
One is to open a field in each activity, and then the participant's ID is saved in this way (1,2,3,4), which makes it more troublesome to find the activity that it participates in according to the user (I developed with TP)
Another is to create a new database, add two fields Activeid (save the Activity ID), Joinid (Save the participant's ID), one save the activity ID, another field to save the participant's ID, as follows
Activeid joinId
1 1
1 2
1 3
This approach may result in more than one record,
------to solve the idea----------------------
The first is the normal way of NoSQL.
The second is the normal practice of SQL
If you use scenario one in a relational database (SQL), there is currently only MySQL support (found through the Find_in_set function)
But pay attention to the capacity of the field
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