简体   繁体   中英

How to store a large list in a database?

I'm starting a project and unsure of the proper way to do this so I just need to be pointed in a general direction.

Essentially, each user stored in the database will have a large list of people (millions) that they want to connect with, and a large list of people they have connected with. The lists of people to connect with will be updated weekly, possibly monthly and duplicates will need to be checked for.

*It might be important to note that the lists of people to connect with won't be users in the system.

Should each list for each user be stored in separate tables and linked to or is there a more efficient structure for this?

Thanks!

One way would be

users table
-----------
user_id
user_name
...


lists table
-----------
list_id
user_id
list_name
...


list_persons table
----------------
list_id
person_name
...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM