#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2013
    Posts
    7
    Rep Power
    0

    Question Algorithms for social networking sites?


    I am developing a social networking site for my college and I need some algorithms for it.
    For example - showing 'N' recent "posts" from "friends", displaying "posts" with "comments", showing list of online "friends", etc.

    Is there any site which deals with this? It will be great if the site also contains articles on things like 'tips' and 'best practices'.
  2. #2
  3. Autodidact
    Devshed Novice (500 - 999 posts)

    Join Date
    Mar 2008
    Location
    Canada
    Posts
    741
    Rep Power
    833
    Originally Posted by gdebojyoti
    I am developing a social networking site for my college and I need some algorithms for it.
    For example - showing 'N' recent "posts" from "friends", displaying "posts" with "comments", showing list of online "friends", etc.

    Is there any site which deals with this? It will be great if the site also contains articles on things like 'tips' and 'best practices'.
    If you're developing this because it's your job and you just want it done, why not install one of several open source social networking frameworks? If you're doing this because you want to learn while you code, you're not going to learn anything by asking for coded solutions.

    There are so many moving parts to a "social network" that you're not just going to find a copy and paste "algorithm" to fit your specific needs. Do you have a "friends" feature? Do you have a feature to "post" original content? Do you have a feature to "comment" on that original content? If you do, then it's just a matter of writing the correct database queries to get the info you want. If you do not, then you've bitten off more than you can chew. Begin writing those core features, then build the code for manipulating that data, so that you can display that data in the ways you've described. However, I suspect you do not have a friends feature or a feature for posting original content, which is going to make your search for "algorithms" a fruitless one. You're asking to install an elevator, but the building ain't got no floors.
    Soldiers, from the height of these pyramids forty centuries look down upon you.
    ▪ Napoleon, on the eve of the Battle of the Pyramids
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2013
    Posts
    7
    Rep Power
    0
    Originally Posted by f_nietzsche
    If you're developing this because it's your job and you just want it done, why not install one of several open source social networking frameworks? If you're doing this because you want to learn while you code, you're not going to learn anything by asking for coded solutions.

    There are so many moving parts to a "social network" that you're not just going to find a copy and paste "algorithm" to fit your specific needs. Do you have a "friends" feature? Do you have a feature to "post" original content? Do you have a feature to "comment" on that original content? If you do, then it's just a matter of writing the correct database queries to get the info you want. If you do not, then you've bitten off more than you can chew. Begin writing those core features, then build the code for manipulating that data, so that you can display that data in the ways you've described. However, I suspect you do not have a friends feature or a feature for posting original content, which is going to make your search for "algorithms" a fruitless one. You're asking to install an elevator, but the building ain't got no floors.

    I am a college student, and this is a project of mine. I want to develop most of the things myself.

    I was not asking for the exact code. Just algorithms, tips and stuff, so that I proceed in the right direction.

    A couple of years ago, I had created a similar site. But it was just a personal project having a very few features. Tested it with a couple of friends. Things is that the algorithm for some of the parts was not very efficient, and it will use up CPU resources as the number of friends grow. In the end, it might become a nightmare!

    I have already scripted features such as posting status updates, updating profiles, etc.

    I just want to write queries for the more complex issues which exert least pressure on the CPU. That's why I am looking for algos & hints which would prod me in the right direction.
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Sep 2006
    Posts
    2,037
    Rep Power
    535
    gdebojyoti, The key is to initially create a good database schema. While it will not make it faster, be sure to normalize your database as it will save you many headaches in the future. Then include the appropriate indexes. Don't worry about the CPU, you queries will not be a problem.

    Comments on this post

    • f_nietzsche agrees
  8. #5
  9. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2013
    Posts
    7
    Rep Power
    0
    Originally Posted by NotionCommotion
    gdebojyoti, The key is to initially create a good database schema. While it will not make it faster, be sure to normalize your database as it will save you many headaches in the future. Then include the appropriate indexes. Don't worry about the CPU, you queries will not be a problem.
    Thank you for your reply. By the way, what is 'normalizing' the database?
  10. #6
  11. Sarcky
    Devshed Supreme Being (6500+ posts)

    Join Date
    Oct 2006
    Location
    Pennsylvania, USA
    Posts
    10,908
    Rep Power
    6352
    HEY! YOU! Read the New User Guide and Forum Rules

    "They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety." -Benjamin Franklin

    "The greatest tragedy of this changing society is that people who never knew what it was like before will simply assume that this is the way things are supposed to be." -2600 Magazine, Fall 2002

    Think we're being rude? Maybe you asked a bad question or you're a Help Vampire. Trying to argue intelligently? Please read this.

IMN logo majestic logo threadwatch logo seochat tools logo