Skip to content

User Profile Storage #17

Description

@jemagee

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.

Activity

  1. blimey85 commented on Jul 29, 2017

    @blimey85

    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.

  2. jemagee commented on Aug 5, 2017

    @jemagee
    OwnerAuthor

    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)

  3. blimey85 commented on Aug 5, 2017

    @blimey85

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions