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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T23:59:09+00:00 2026-05-18T23:59:09+00:00

I have a table for user and another table for follower . The followers

  • 0

I have a table for user and another table for follower. The followers table is a list of user_ids and follower_ids. Seems pretty straight forward.

I’ve been planning on using mysql for production and I feel like down the road, this is really going to bite me in the a$$

Should I switch to MongoDB? Is it too late?

I’ve never dealt with NoSQL-anything and I’m wondering how to get around the issue of joins. I wouldn’t care about putting a little effort forth to fix this problem except I separated my users from their profiles. I am under the assumption that activerecord uses joins in a statement such as @name = User.profile.full_name

  • 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-18T23:59:10+00:00Added an answer on May 18, 2026 at 11:59 pm

    What you need to consider is separating, conceptually, the data storage technology from your data structure. MySQL can be scaled, scaled, and scaled some more if you know how to do it as it’s an old and proven platform. While it probably doesn’t have the same shiny new appeal of something like NoSQL, it does have a very good track-record and that’s often what counts.

    There’s a number of ways to tune MySQL to perform more quickly. The built-in clustering and replication features mean you can often scale up to multiple instances very easily, and using a simpler, faster database engine like MyISAM can give you order-of-magnitude performance gains in some circumstances.

    MongoDB is a very interesting experiment, but so far it hasn’t really earned its stripes. If it’s anything like other noble NoSQL projects like Cassandra it will still need years of work to be truly “web scale”.

    In your particular case, let’s say you want to find a list of a user’s followers. You’re probably doing something like this:

    SELECT followers.id, followers.name FROM user_followers
      LEFT JOIN users AS followers ON followers.id=user_followers.follower_id
      WHERE user_followers.user_id=?
    

    You’re right in presuming that the JOIN here will cause trouble down the road. What you’re overlooking is that you can easily remove the join using the same humble trick that is essential to making your application scale: denormalizing important information.

    What if you copied the follower’s name into the user_followers table each time you add an entry to it:

    SELECT follower_id, follower_name FROM user_followers
      WHERE user_id=?
    

    Now there’s no joins. The only catch is that when you start to denormalize things you should implement a method to bring the copies back into sync from the master should something get messed up, and you must be careful to ensure that a change in the master value should propagate to the copies as expediently as is required.

    A simple mass update could be as easy as:

    UPDATE users,user_followers
      SET user_followers.follower_name=users.name
      WHERE user_followers.follower_id=users.id
    

    If the users are unable to change their names, though, you wouldn’t even need to worry. Sometimes constraints can help you in this regard.

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

Sidebar

Related Questions

I have a table [User] and another table [Salesperson] in my database. [Salesperson] defines
I have a table (user) that contains user information. I have another table (userview)
I have a table User which has an identity column UserID , now what
I have a user table in my mysql database that has a password column.
We have a user table, every user has an unique email and username. We
In my Ruby on Rails app, I have a User table and a Foo
When designing user table what would be the must have fields from the security/user
I have a table with three columns: user varchar, status varchar , rep int
I have a postgres database with a user table (userid, firstname, lastname) and a
I have a table UserAliases ( UserId, Alias ) with multiple aliases per user.

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.