Industry


Ads by TechWords

See your link here


Mark Everett Hall's picture
Mark Everett Hall

Sanity as a Service

Lessons from Twitter: Build a social network the right way

If you can't find a social network that fits your lifestyle, clearly you're not looking very hard. Lawyers have social networks. Moms have one. And there's even one designed for business colleagues inside a company.

But maybe there's a niche that hasn't been covered. So you or your boss might be chomping at the bit to build a social network, watch the traffic grow and strike it rich. (A profitable business model for social networks will eventually emerge, if you cross your fingers, twirl three times and repeat your business slogan backwards during each spin.) After all, just look at Twitter's amazing growth or Facebook's huge user population. There's got to be gold in social networks, right. Riiiiight.

Well, if not gold, at least lots of people. And with those people come expensive demands on your data center and network. Demands that have brought Twitter to its knees on more than one occasion.

So, how do you build a scalable social network? First, make smart technology choices. Skipping Ruby on Rails might be a start, given what Coding Horror says about the 100:1 performance penalty it can entail over compiled code like you get from C++ or VisualBasic.

Bruno Rovagnati, social network guru at Globant in Buenos Aires, Argentina, says while Ruby on Rails "is in fashion right now," it may not be the best language for high-traffic, performance-dependent sites.

But beyond picking the best language for the task, Rovagnati says there are things you can do during your development phase to improve the odds your site won't become the poster child for poorly designed Web sites.

First, he says, split your core services so they can be executed separately. For example, such things as search, login and photo uploading should be modules outside the social network app. He says in Twitter the designers integrated search with the main site, which can lead to very sluggish response times for search results.

Second, create subdomains you can direct traffic to. This can help, say, when you need to balance spikes in login traffic.

Third, Rovagnati suggests, use content delivery networks. Remember, Akamai is your friend.

Finally, cache database data. A big DB cache will greatly improve your performance, he says.

Now you're ready to launch a successful, high-traffic, sticky social network site. And if you figure out how to make money on it, let us know how you did it. We all want to believe in miracles.

What People Are Saying

New Social Media Sites

So if someone had an idea for a new social network site that would more than likely eclipse facebook and MySpace in overall users but may not have as many pageloads at one time, would you suggest using Ruby or some other environment. I have very little knowledge in this area but am learning quiclkly. I mean wouldn't it really all boil down to smart design and development at the outset. I have come up with an idea and have no idea where to take it. I just know that it would need to be designed to work and allow for massive users from the very beginning. If anyone has any ideas or advice I could sure use it....thanks

Outdated background info?

The quote from Jeff Atwood (Coding Horror) is several years old. I'm sure the Twitter folks are a lot farther down the line at this point in time. The other comments seem to be sound. Regarding compiled vs. interpreted languages, there is even a PHP compiled framework that runs on Microsoft .NET, so this is only a part of the overall scalability picture.

Really?

The vast majority of websites won't have traffic anywhere near that of Twitter's, and even if they do they aren't going to run into the unique set of problems that Twitter did unless they too are essentially a messaging services.

There's a reason why the folks at Twitter are sticking to Rails for the front end - despite their gargantuan number of page views these days. Because rails scales as well as any other web framework or language (just ask yellowpages.com or hulu.com if they agree).

The simple fact is that if it weren't for the productivity gains Rails gives developers, Twitter probably wouldn't even have been prototyped in the first place. They created it in the few hours of spare time they had per week and that's really kind of the whole point. Had they been using less convenient and elegant frameworks and languages to develop it I doubt they would have had the time or motivation to even make the attempt in the first place.

Mark, I agree with you. Ruby

Mark, I agree with you. Ruby can scale. As PHP (see FB) or python. Maybe is not so structured as J2EE to make it easier.

In the case of Twitter the main issue wasn't the language, but their software design issues. Hopefully they are improving a lot and that is changing and the system is much more stable compared to the one 1 year ago. Don't you agree?

My main language is PHP, and I love it because is so flexible that lets you prototype (and also go to production) very fast, as Ruby and pyhton. But you have the drawback of the lack of structure in the core of the language. And if you are not a good developer, you will have problems to scale for sure.