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

  • Home
  • SEARCH
  • 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 7790367
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T21:33:47+00:00 2026-06-01T21:33:47+00:00

I would like to allow users to follow other users as with Twitter, Instagram

  • 0

I would like to allow users to follow other users as with Twitter, Instagram etc. Am thinking that this should include table structure something like following:

Users with userid, password, email, fname, lname

Followers with userid1(INT), followstatus(TINYINT), usererid2 (INT)

New row is created when user1 decides to follow user2. Later follow status can be turned off if user1 decides to no longer follow user2. There would be a separate entry if user2 follows user 1

I can tell user1 whom he is following with query to this table. And tell users how many people are following them with count query. Then conditional on this relationship, print out info on user2s actions (followee) to user1 (follower).

Is that best practice? Or is there more to it…. Are there other fields, tables required?

Note: users have another table of people, not necessarily users but I’m thinking follower status should be in separate table.

  • 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-06-01T21:33:49+00:00Added an answer on June 1, 2026 at 9:33 pm

    That looks good. One note, though: if your project will really take off, you’ll soon grow out of a single machine and will have to shard. That means breaking your user and relation tables into smaller ones. It’s a big topic and out of scope here.

    Once you break them, a certain type of queries becomes difficult or impossible.

    For example, now it is simple to query “who follows me”.

    select * from followers where user2 = me;
    

    or “whom do I follow?”

    select * from followers where user1 = me;
    

    Once you break the followers table, one of these queries will be impossible (because the data may span multiple tables/databases/servers). To overcome this, you might want to create two tables:

    i_follow (user1 int, user2 int)
    follow_me (user1 int, user2 int)
    

    and insert corresponding records on each new relation.

    This is just tip of the iceberg. Embark on this journey and you’ll find many interesting problems to solve 🙂

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

Sidebar

Related Questions

I would like to allow users to call my ruby on rails app as
I have a ASP.NET 3.5 web application and I would like to allow users
I'm using CKEditor and would like to be able to allow users to upload
I would like to allow only one country access, but exclude proxies within this
I'm building a web app that will (ideally) allow users to follow discussion threads
Is there a plug-in for Firefox that would allow user's Javascript code like Greasemonkey
I would like to create a simple file format/DSL which would allow my users
I would like to allow the user to click within my UserControl and drag
I would like to allow a user to click on a JList and if
I'm creating a new WP theme and I would like to allow the 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.