CQuotient Blog


The R&D team at CQuotient likes to use tools at the cutting edge (who doesn’t?). So when the time came to select the framework for our cloud-based reporting and dashboarding infrastructure, we decided to give the nodejs/mongodb stack a try.

Here is what our stack evolved into:

We ended up using the awesome Express framework for building our sites with mongodb serving up the data (using mongoose & express-mongoose for the database interface layer). After initial attempts at rolling our own css framework, we switched mid-way to using twitter’s bootstrap. We used jade for templating, and stylus for additional css bits that bootstrap didn’t have. User authentication is handled by passport & openid. Of course, no dashboard is complete without pretty graphs and up-to-date information about our daily processes. Sticking with the javascript theme, we used d3.js for all plots and visualization.

Along, the way we learned some interesting lessons

We built very pretty interfaces that looked great in Chrome & Safari. But reality hit when we had to support the old IE versions that our end-users have installed on their computers. Initially, we spent a lot of time using css3pie and html5shiv to make things work. Switching to bootstrap fixed a majority of these problems (except for rounded corners). In hindsight, a lot of time could have been saved by using bootstrap from the get go.

So lesson learned: In the Enterprise world, old versions of IE still reign, make sure your pretty cutting edge webpages work on it!

The saga of supporting multiple browsers is second only to the saga of supporting multiple email clients that would be used to view our emailed reports. Our initial attempts at using existing web views to build these email reports was an abject failure. In the end, we bit the bullet, travelled back to 1995 and used tables to layout the html with inline css for styling. Tools like premailer didn’t do the job on the css we had.

So lesson learned: Avoid html email :)

Mongodb+Nodejs is insanely fast. That is not to say that if we had used php+mysql we would have done any worse. Our current data sizes for reporting and dashboarding are small enough to not require sharding. All our queries avoid joins and use simple selects from denormalized tables and it seems to work pretty well.

So lesson learned: Honestly, we were quite surprised at how well this stuff worked. Many thanks to the server side javascript community for inventing new and useful packages at a fantastic clip.