The Official Klout Blog

The Tech Behind Klout.com

October 4th, 2011 by Kevin Liu

In May, we unveiled the current version of Klout.com. Not only did we put the site through a major visual/UX/UI redesign, we rewrote the entire front-end web application from the ground up. Here’s an overview of the tech that drives the user experience of Klout.com.

The Old Stack
Klout.com is a data-driven company, and our first product was the Klout API. We repurposed a lot of the early API code (PHP) to power the first iterations of Klout.com on the LAMP (Linux/Apache/MySQL/PHP) stack to allow users to access their own scores. As Klout’s user base began to grow, scaling the performance of the website was getting in the way of creating interesting new features. We knew we would have to refactor the site to keep up with traffic and to create a flexible foundation for feature development. With carte blanche, we wanted to do something innovative and new while having fun with high-performance web technologies. Inspired by #NewTwitter and the work of JavaScript luminaries like Ryan Dahl and Yehuda Katz, we chose to go where few had boldly before: a fully JavaScript-based web application.

Enter Node.js
We were intrigued by the nascent server-side applications of JavaScript. Google’s V8 engine was incredibly fast, and Ryan Dahl’s node.js was the missing evented I/O layer that finally made running JavaScript on the server a reality. Packages like Express made handling routing and content negotiation seamless. In our tests, a single node.js process was able to handle thousands of concurrent connections in a very CPU-efficient manner. Plus, using JavaScript on both the server and the client made writing multi-purpose code very straightforward. We knew of other companies using node.js at the time, but most were using it to serve APIs. It seemed nobody was brave (or crazy) enough to serve an entire website with it… yet.
Betting everything on such a young technology was a risk, but in the spirit of trailblazing and entrepreneurship, Klout wanted to help prove out this very promising architecture. Ryan Dahl and Joyent helped us over hurdles in our early development and listened to our feedback. As a result, Klout is running on node.js in 16 instances across two servers in our own data center, serving tens of thousands of concurrent users.

The Client-Side Application
Most of Klout.com actually runs in your own browser — we use Backbone.js to provide a MVC (model-view-controller) structure on the client side. After your first page load, your browser begins talking to our node.js application servers to get bits of information in JSON (JavaScript Object Notation), such as scores, topics, and chart data. As you navigate around the site, only the relevant, changed portions of the page refresh and redraw. We use Yehuda Katz’s Handlebars.js for minimal, semantic templating and LESS CSS for dynamic stylesheet programming. All of this adds up to a very snappy user experience on Klout.com.

Open Source
We depend on many open-source technologies, including Node.js, connect/Express, Backbone.js, Handlebars, Underscore, jQuery, and Redis. Klout is grateful to the open-source community and is committed to contributing back to projects that have helped us build such a rich and modern web application.
Klout continues to evolve as this new stack evolves, and we’re excited to be at the forefront of what we believe to be the future of web application development. Each stable release of each component of our stack brings new performance and stability enhancements. Staying on the bleeding edge of web technology is a huge effort, but the end result is a constantly improving experience for our users.

If you want to set the standard for the future of web application engineering while helping the everyone in the world unlock their Klout, join us!

This entry was posted on Tuesday, October 4th, 2011 at 7:51 am and is filed under engineering, measuring influence. You can follow any responses to this entry through the RSS 2.0 feed.

You can leave a response, or trackback from your own site.

  • http://twitter.com/ericvs Eric VanderSchaaf

    What about the tech that drives the back end?

  • http://twitter.com/meganberry Megan Berry

    Hey Eric,

    We’re going to be sharing more about the tech we’re using and insights from our engineering team. One of those will definitely be about the tech that drives the back end. Stay tuned!

    -Megan
    Marketing Manager, Klout

  • http://qzaidi.github.com Qasim

    Very interesting. Would like to know what is the database backend and if you have come across some mature ORM in node.js.

  • Jon Hines

    inspirations for us JavaS guys to shoot for. thanks for sharing!

  • Pingback: An Easy Way to Build Scalable Network Programs « node blog

  • http://twitter.com/taariqlewis Taariq Lewis

    Congrats Klout Team!

    Why did you guys choose backbone vs. any other MVC?  There are so many around and some folks have shared that backbone.js has its limitations.  Also, have you hit up any issues using node.js that other startups should be careful to take note?

  • http://www.arlocarreon.com Arlo Carreon

    Awesome work on the site and the JS!!! Love it.

  • http://twitter.com/easyPblog Keith Davis

    Hi Tyke
    Great info but so much of it and so closely spaced!

    Bigger text and a bit more white space would make the page look a lot less daunting.

    Thanks peeps.

  • http://butyoureagirl.com adriarichards

    Thanks for taking the time to share the software that runs Klout as well as your exploration into new technologies to deliver better performance for a kick ass customer experience!

  • http://floatboth.com MyFreeWeb

    So you’re storing everything in Redis? Or is there a database? If so, NoSQL or SQL?

  • http://twitter.com/davehoff Dave Hoff

    Great stuff! Would really love to hear more about your storage engine choices, how you arrived at them and how you connect to them from node. Thanks again.

  • http://twitter.com/algoritmove Algoritmo de Vnzla

    Thank you Klout, your are GREAT!

  • http://twitter.com/algoritmove Algoritmo de Vnzla

    I want to know more about your technology and experience with JavaScript! Best regards Klout

  • http://twitter.com/ryderskull88 Reynaldo Catapia

    Thank you for sharing this information for everybody to know more what the technologies behind Klout.

  • http://twitter.com/ShivtwittS Shivbhadra Gohil

    Just read about Node.js for the first time at other website and now seeing it again…

  • Anonymous

    Hi Tyke, many thanks for sharing this. We are suffering from scaling issues due to legacy stack, and keen to learn more. Would you mind dropping me an email manoj.ranaweera at edocr.com – love to chat more.

    Best regards
    Manoj

  • Pingback: En Klout nos descubren sus tripas tecnológicas

  • Pingback: En Klout nos descubren sus tripas tecnológicas | PÁGINA WEB GRATIS y DISEÑO WEB GRATIS

  • Pingback: The World In Links (10/10-10/16/2011) - Analytics, Coffee, Klout

  • http://www.listio.com/web20/user.php?login=michael52&view=history Connie Moree

    Great info! Thank you for publishing. We’ll be returning shortly from now.

  • http://twitter.com/pulkitmittal07 Pulkit Mittal

    What keeps the score ticking? I’ve noticed my friend’s score dropping considerably, though he was almost consistent with the no. of tweets he made, the content he shared, the followers he had, etc. At the same time, my score raised heavily, though I reduced my frequency of updating, lost some followers, etc.

  • Pingback: The BIGBible Project | Influence – what is it good for?

  • Mike Barnlund

    Cool stuff – I’ve been pushing for my team to start using node.js where appropriate and it’s great to have some success stories.

  • Pingback: Jeff Johnson Non-Stop Traffic Formula

  • Pingback: Handbags

  • Pingback: Faustus Eberle

  • Pingback: If you need web seo service check this place out.

  • Pingback: JM Asset Management Inc.

  • Pingback: Free Facebook App And Viral App

  • Pingback: Google Places Advertising

  • Pingback: giao diện Việt - giao dien website

  • Pingback: Mandura Business Opportunity

  • Pingback: colorado seo

  • Pingback: world best tech blog

  • http://twitter.com/joshminnich Josh Minnich

    I made the move to NodeJS back when it was version 0.3.9 and have loved it ever since. I’m glad to see other people are using it to power their websites. Only thing I don’t understand is the use of Handlebars for tempting. The reason I ask is because you’re already using Backbone which has a dependency of Underscore, and Underscore has built in templating. If it was for syntax reasons I suppose that makes sense, but hopefully not for performance.

    Congratulations on the revamp!

  • Anonymous

    As a true reach, it measures how many people you influence and focuses on the people who are working on your new google gadgets. Amplification gives information about how much you influence people, while your network shows advanced gadget shop the influence of the people in your True Reach.
     

  • Pingback: API – Mashup.se

  • Pingback: The Tech Behind Klout.com « Measuring Online Influence: The Official Klout Blog « Log Book