Coming soon - Get a detailed view of why an account is flagged as spam!
view details

This post has been de-listed

It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.

3
How to store user skills/languages in the database?
Post Body

Hello

I'm relatively new to web programming so I'm iffy when it comes to best practices of most everything.

Currently I'm trying to recreate the Linkedin user profile page but I've hit something of a snag. See, each user has the option to enter a number of 'skills', 'languages' they know, 'certifications' and whatnot.

Initially, I thought that creating a 'Skill' model and storing each skill as a new row in the db was nuts (ie: (id=1, user_id= 15, skill_name=blabla), (id=2, user_id=15, skill_name=yaya)). So instead I decided to just have skill_name be an array, and store all the user skills in a single table row.

After a crapload of googling I managed to get the thing working properly; the user can remove, reorder and add skills to the array through some ajax shenanigans. However, now that I'm about to move on to doing other stuff I'm wondering if doing that was actually a good idea.

So my question is, was there a better way to handle that problem? Does it matter if a user has too many entries in a table (10 )? If it does, how many entries is too much?

I'm also wondering if doing the array thing for something like languages is a good idea. Unlike skills, I can probably limit languages to a max of 5? rows per User. Same for certifications, projects, publications etc.

I'm using the Rails framework btw.

Author
Account Strength
90%
Account Age
10 years
Verified Email
Yes
Verified Flair
No
Total Karma
1,158
Link Karma
22
Comment Karma
1,136
Profile updated: 1 day ago
Posts updated: 8 months ago

Subreddit

Post Details

We try to extract some basic information from the post title. This is not always successful or accurate, please use your best judgement and compare these values to the post title and body for confirmation.
Posted
7 years ago