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 6801255
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T19:04:39+00:00 2026-05-26T19:04:39+00:00

I’m not very well traversed in database design so I’ve come to you guys

  • 0

I’m not very well traversed in database design so I’ve come to you guys for help. I have a table with records of users. The tablet looks like thing like this:

+----------+----------+----------+----------+----------+----------+----------+---------
| id       | username | password | firstName| lastName | birthDate|  pictures|  .....
+----------+----------+----------+----------+----------+----------+----------+---------
|    .     |    .     |    .     |    .     |    .     |    .     |    .     |  
|    .     |    .     |    .     |    .     |    .     |    .     |    .     |  .....
     .          .          .          .          .          .          .        

The pictures field indicates how many pictures a user has uploaded.
I have written a feature that allows users to upload pictures to our servers. The file uploaded is named to something random. Users are only allowed 6 images.
I am currently getting the location of the file and storing the locations in a table that looks like this:

+----------+----------+----------+----------+----------+----------+----------+---------
| id       | username | default  | pic1     | pic2     | pic3     |  pic4    |  .....
+----------+----------+----------+----------+----------+----------+----------+---------
|    .     |    .     |    .     |    .     |    .     |    .     |    .     |  
|    .     |    .     |    .     |    .     |    .     |    .     |    .     |  .....
     .          .          .          .          .          .          .        

Assuming a user has more then 0 pictures, when a users profile is visited the ‘default’ field is called upon to get which column stores the address of the default picture. For example if ‘default’ is equal to 2, the data from column ‘pic2’ would be pulled and returned first, then the other non empty columns would return their respective data.

My first question is: is this method of having multiple tables a bad idea? Is implementing a design where a picture has its own column a bad idea?
As you guys can see this method is not scaleable in the least bit. What would be a good, efficient, scaleable design to implement this profile system? I am expecting to have 50,000 – 60,000 users.

Also if possible recommend me a good book that will give me a crash course in database design! (crash course please nothing too long or detailed!)

  • 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-26T19:04:40+00:00Added an answer on May 26, 2026 at 7:04 pm

    Unless there are very specific reasons why you need this design (highly doubt it) I think you should go with something like:

    users:
    - id
    - username
    - email
    - ...
    
    pictures
    - id
    - user_id
    - default (or order)
    - picture_location
    

    This scales well (assuming you have an index on user_id) and also you can easily change your mind on the max pictures per user restriction. The restriction will, of course, be enforced by your application.

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

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I have a reasonable size flat file database of text documents mostly saved in
I have a view passing on information from a database: def serve_article(request, id): served_article
Let's say I'm outputting a post title and in our database, it's Hello Y’all
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
I have just tried to save a simple *.rtf file with some websites and
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a small JavaScript validation script that validates inputs based on Regex. I
this is what i have right now Drawing an RSS feed into the php,
I have this code to decode numeric html entities to the UTF8 equivalent character.

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.