April 21st, 2013, 01:46 PM
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'.
April 21st, 2013, 03:57 PM
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.
Originally Posted by gdebojyoti
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
April 22nd, 2013, 12:41 AM
Originally Posted by f_nietzsche
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.
April 22nd, 2013, 06:36 AM
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
April 22nd, 2013, 10:18 AM
Thank you for your reply. By the way, what is 'normalizing' the database?
Originally Posted by NotionCommotion
April 22nd, 2013, 10:20 AM
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.