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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T16:17:20+00:00 2026-05-31T16:17:20+00:00

I am writing a social networking web app with couchdb as backend. Currently I

  • 0

I am writing a social networking web app with couchdb as backend. Currently I am maintaining user profiles as JSON docs.

My app has a friendship feature when one user will request other user and upon acceptance the friendship is solemnized. Besides friendship there is one way relationship called “follow” relationship as well.

I thought of creating a connection doc

{ 
source_user:'',
target_user:'',
source_follows_target:'',
target_follows_source:'',
..Similarly for friendship...
}

This doesn’t look right to me at all. Since the relationship exists between two exactly similar entities (users in this case) I dont thin the model should try to distinguish between source and target.

  • 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-31T16:17:21+00:00Added an answer on May 31, 2026 at 4:17 pm

    The fact that the relationship can be (or is always) symmetric doesn’t mean it necessarily has to be modelled as one logical relationship. I think it might more general to model the possibility of either, and then prevent one-way friendships in your application if you so desire.

    In which case for each user you might have a set of users that they consider their friend (One -> Many). You could store a copy (or cache) of whether it is symmetric or not on each of these relationship objects to make it a bit more scalable.

    A rough example of how a user object might look:

    {
        "userId": 1,
        "friends": [{"userId": 2, "friendsBack": true | false}, ...]
    }
    

    Operations on these sets of users, e.g. intersections (friends in common), would then be a lot easier since they are accessed directly from the user object.

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

Sidebar

Related Questions

I am currently writing a multi-user social iPhone app which interfaces with a server.
I'm writing a social networking app that has contacts sync functionality. I have working
Using Entity Framework, I am writing a social networking app and trying to setup
I am writing an iPhone app – a client for some social network. The
Writing the code for the user authentication portion of a web site (including account
Background I am developing a social web app for poets and writers, allowing them
I am writing small social application. One of the features is to write user
I'm writing a social networking application in VB.NET, with a target userbase of 1-2
I am writing a social app where people will use TAGs for organizing their
I'm currently working on two social networking sites that have a lot in common,

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.