Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3598978
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T20:18:36+00:00 2026-05-18T20:18:36+00:00

I am trying to develop a database for a website. This website has registered

  • 0

I am trying to develop a database for a website. This website has registered users and these users can befriend other users. Much like any traditional social networking site. Now my problem is, I have to store the friends list of each every user and also his profile information. Each user has his own profile id. Apart from this each user is allowed to create groups for his friends and there is also a status field that says the status of the friendship between the two users.

Now to do this I thought of two solutions:

  1. Maintain a table named profiles, in which each user has a profile id and his other profile information and have a global friends table, that has his profile id and his friends profile id. And the other fields would describe, the group, the user has chosen for the particular friend and a status for their friendship and so on.

  2. Maintain a table named profiles, in which each user has a profile id and his other profile information like above and have a separate friends table for each user that says something like friends_profileid, and each user has his own friends list which has all other information.

Which of the above two techniques is more appropriate? I am using MySQL Server 5.0 and I also considered using abstract data types and array types, but that’s making the front-end implementation more complex and difficult and cumbersome. While the first technique is increasing the number of rows in a single table at a very high rate, the second technique is increasing the number of tables to be proportional to the number of users? What is more advised? More number of tables or more number of rows?

While the second technique decreases the over head of searching in a single table, what is the overhead of storing the schema again and again? What is the best method for this type of a situation?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T20:18:37+00:00Added an answer on May 18, 2026 at 8:18 pm

    SQL was designed to work with a variable number of rows over a fixed set of relationships.

    Problems with 1-table-per-user (just off the top of my head):

    1. Stuck with a bunch of hard-to-access and hard-to-maintain tables. No simple way to run queries spanning multiple users. Limits on query size to try to “decompose” these tables in a single query. Most SQL/ORM layers do not provide a nice way to handle this.
    2. The queries generated would need to be “dynamic” with different tables substituted in. While this wouldn’t “change the shape”, it is hard/impossible for a static analyzer to know this (perhaps that would introduce the notion of a “template”? — more complexity. no thanks!). This applies to verifying if SQL DDL/DQL is valid (if such tools are used), removes the ability to use static-generated ORMs without additional work, and places more load on the query processor/analyzer.
    3. Could/would also generally lead to worse query plans and overall performance as in the general case, each table (say 100k? no thanks!) would need to be treated independently with potentially huge lack of logical locality. You may also be pushing on some upper RDBMS limits (on the other hand, tables with 2 million records are “small”).

    Conclusion: Please use your RDBMS to its strengths — the world has run on SQL for decades now (at least 2 😉 and most [trivial] problems have been solved numerous times.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to develop a database for a website. This website has registered
I am trying to develop a database model for a recruitment website and I
I'm trying to develop a table that can be used to edit database information
I am trying to develop everything in sharepoint as features so I can easily
I'm new to Codeigniter and I'm trying to develop a simple website with a
I'm trying to develop an online formbuilder. Each user can build their own forms
I am trying to develop a system where this application allows user to book
I am trying to develop a system that has 2 tiers: a mobile client
I'm trying to develop ORM for database synchronisation and decided to give Java reflection
I am currently trying to develop a website where I need to have 2

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.