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

  • SEARCH
  • Home
  • 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 7952255
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T02:48:19+00:00 2026-06-04T02:48:19+00:00

I am designing a system which has a database for storing users and information

  • 0

I am designing a system which has a database for storing users and information related to the users. More specifically each user in the table has very little information. Something like Name, Password, uid.

Then each user has zero or more containers, and the way I’ve initially done this is to create a second table in the database which holds containers and have a field referencing the user owning it. So something like containerName, content, owner.

So a query on data from a container would look something like:

SELECT content
  FROM containers
 WHERE (containerName='someContainer' AND owner='someOwner');

My question is if this is a good way, I am thinking scalability say that we have thousands of users with say… 5 containers each (however each user could have a different number of containers, but 5 would probably be a typical case). My concern is that searching through the database will become slow when there is 5 entries out of 5*1000 entries I could ever want in one query. (We may typically only want a specific container’s content from our query and we are looking into the database with basically a overhead of 4995 entries, am I right? And what happen if I subscribed a million users, it would become a huge table which just intuitively feel like a bad idea.

A second take on it which I had would be to have tables per user, however that doesn’t feel like a very good solution either since that would give me 1000 tables in the database which (also by intuition) seem like a bad way to do it.

Any help in understanding how to design this would be greatly appreciated, I hope it’s all clear and easy to follow.

  • 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-06-04T02:48:21+00:00Added an answer on June 4, 2026 at 2:48 am

    The accepted way of handling this is by creating an INDEX on the owner field. That way, MySQL optimized queries for owner = 'some value' conditions.

    See also: http://dev.mysql.com/doc/refman/5.0/en/mysql-indexes.html

    You’re right in saying that a 1000 tables is not scalable. Once you start reaching a few million records you might want to consider doing sharding (split up records into several locations based on user attributes) … but by that time you’d already be quite successful I think 😉

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

Sidebar

Related Questions

I am designing a System which has different types of Addresses. For example, a
Consider we have a database that has a table, which is a record of
I am designing a room booking system which has nine entities, which all relate
I'm designing a PHP Products system which is required to be very general, in
We are currently designing the security of a system, which has a WPF client
Some background, I've been designing a user profile for our Django database system and
I am designing an inventory system. Each inventory item's taxes need to be calculated
When designing a stock management database system for sales and purchases what would be
I am currently designing a role based authentication system for resources where many users
We are designing database schema for a new system based on Oracle 11gR1. We

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.