Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

User Profile Storage #17

Open
jemagee opened this issue Jun 24, 2017 · 3 comments
Open

User Profile Storage #17

jemagee opened this issue Jun 24, 2017 · 3 comments

Comments

@jemagee
Copy link
Owner

jemagee commented Jun 24, 2017

What's the best way to deal with the user profile storage issue. There's possibility a lot of information to store on users, hopefully it can be set up to be indexed and quickly accessed and processed when needed. Non SQL solutions are of course welcome.

@jemagee jemagee created this issue from a note in User Profile (Pending) Jun 24, 2017
@blimey85
Copy link

You're using Devise so you have two options. You can store everything in a profile table that's associated with users table. This is the cleaner approach. current_user.profile.name gives you the user's name. However, that's adding a useless abstraction. I prefer to include profile info in the user table, then current_user.name is all that's needed.

When you get to where you have for example, posts which have comments which have votes and you want to know who voted, having one less abstraction is nice IMO.

I've read a lot about this and the community seems pretty evenly divided. For anything with multiples you use a separate table. So avatar being a single image would go into user, photos would get their own table.

That's how I prefer to set things up.

@jemagee
Copy link
Owner Author

jemagee commented Aug 5, 2017

I think your point is valid and makes total sense, though some user information isn't 'singular' and having it in a different location/table makes more sense for future functionality (i.e. matching up people with similar skills...for instance, find all the users in time zone a who are available during A or B and want to learn x from a beginner level).

I tend to overthink future functionality on things which is why things stall (and I tend to need some help it seems)

@blimey85
Copy link

blimey85 commented Aug 5, 2017

Well yes, I said anything with multiples goes in a separate table. I was simply stating my take on the pros and cons of also having an additional table for profile data.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

No branches or pull requests

2 participants