Clock Limited
       Node.js Showcase
Tour credentials




                          1
INTRODUCTION

•   Award-winning digital media agency. Clients include:

      •   BBC
      •   Channel4
      •   Stonegate Pub Group
      •   News International
      •   Eddie Izzard
      •   Shortlist Media

•   Over 10 years in business.

•   Historically a PHP-only house.

•   Started experimenting with node.js about a year ago.




                                                           2
Eat Out Dining Card
   http://www.eatoutdiningcard.co.uk/


   •   A service for Times and Sunday Times
       subscribers.

   •   Restaurant search engine.

   •   Special offers.

   •   Corresponding back-end CMS.




                                              3
SunPerks
  https://www.sunperks.com/

  •   Loyalty scheme for The Sun newspaper.

  •   10 week long campaign.

  •   A choice of ~150 items shown in the online
      catalogue.

  •   Tight integration with NewsInt’s infrastructure
      and fulfilment agencies via API calls and
      exposed API.




                                                        4
SunPerks
  https://www.sunperks.com/

  •   Went live with an empty user base.

  •   Currently have ~300k registered users.

  •   Advertised daily in The Sun; TV advertising;
      linked from mail-outs across other NewsInt
      offerings (e.g. Times+).




                                                     5
Development Strategy
  •   Both sites developed and hosted in the same
      way.

  •   Tightly project managed to strict sprint
      commitments and deadlines.

  •   Testing before deployments
        • Expresso for unit tests.
        • Selenium with Soda for acceptance
            testing.

  •   Naturally, strict change control in place after
      deployment.




                                                        6
Software Architecture
  •   End-to-end JavaScript:

        •   jQuery

        •   Node.js

        •   MongoDB




                               7
Node Application
Architecture
 •   Application built on Express framework.

 •   Heavy use of Async.js for asynchronous flow
     control.

 •   Jade and Stylus.

 •   Underscore; Formidable; gm; nodemailer.




                                                   8
Clock’s NPM Modules
  •   Piton-* suite of node modules

        •   piton-entity
        •   piton-pipe
        •   piton-http-utils
        •   piton-mixin
        •   piton-simplate
        •   piton-string-utils
        •   piton-validity


  •   Gzippo – zlib connect middleware




                                         9
Hosting Platform

  •   Single KVM virtual machine per site.

  •   Quad-core recent Intel Xeons with 4GB RAM.

  •   Ubuntu Linux 10.04 LTS.




                                                   10
Init & Monitoring
  •   Cluster.js forks a worker per CPU, and
      monitors.

  •   Upstart scripts control site (start, stop, restart).

  •   Monit monitors and (re)starts node if
      necessary.

  •   Remote Nagios instance also monitors and
      alerts via SMS of problems.




                                                             11
Conclusions
  •   Great performance:
        • ~300 req/s, peaking at 400 req/s
        • Maximum 100 registrations per minute
        • Server load maximum 5.

  •   Client is extremely happy with the sites.

  •   Internally, node.js has now become our
      preferred environment for web application
      development.

  •   Designers have taken very quickly to Jade and
      Stylus, and love using them.

  •   As effective for developing website as with
      PHP even with the additional learning.

  •   In the future leveraging more of the things
      node.js is best at. Real-time apps, etc.
                                                      12
Fin
      Thanks for listening!




                              @mikecronn




                                           13

Cyber-Duck node.js Showcase

  • 1.
    Clock Limited Node.js Showcase Tour credentials 1
  • 2.
    INTRODUCTION • Award-winning digital media agency. Clients include: • BBC • Channel4 • Stonegate Pub Group • News International • Eddie Izzard • Shortlist Media • Over 10 years in business. • Historically a PHP-only house. • Started experimenting with node.js about a year ago. 2
  • 3.
    Eat Out DiningCard http://www.eatoutdiningcard.co.uk/ • A service for Times and Sunday Times subscribers. • Restaurant search engine. • Special offers. • Corresponding back-end CMS. 3
  • 4.
    SunPerks https://www.sunperks.com/ • Loyalty scheme for The Sun newspaper. • 10 week long campaign. • A choice of ~150 items shown in the online catalogue. • Tight integration with NewsInt’s infrastructure and fulfilment agencies via API calls and exposed API. 4
  • 5.
    SunPerks https://www.sunperks.com/ • Went live with an empty user base. • Currently have ~300k registered users. • Advertised daily in The Sun; TV advertising; linked from mail-outs across other NewsInt offerings (e.g. Times+). 5
  • 6.
    Development Strategy • Both sites developed and hosted in the same way. • Tightly project managed to strict sprint commitments and deadlines. • Testing before deployments • Expresso for unit tests. • Selenium with Soda for acceptance testing. • Naturally, strict change control in place after deployment. 6
  • 7.
    Software Architecture • End-to-end JavaScript: • jQuery • Node.js • MongoDB 7
  • 8.
    Node Application Architecture • Application built on Express framework. • Heavy use of Async.js for asynchronous flow control. • Jade and Stylus. • Underscore; Formidable; gm; nodemailer. 8
  • 9.
    Clock’s NPM Modules • Piton-* suite of node modules • piton-entity • piton-pipe • piton-http-utils • piton-mixin • piton-simplate • piton-string-utils • piton-validity • Gzippo – zlib connect middleware 9
  • 10.
    Hosting Platform • Single KVM virtual machine per site. • Quad-core recent Intel Xeons with 4GB RAM. • Ubuntu Linux 10.04 LTS. 10
  • 11.
    Init & Monitoring • Cluster.js forks a worker per CPU, and monitors. • Upstart scripts control site (start, stop, restart). • Monit monitors and (re)starts node if necessary. • Remote Nagios instance also monitors and alerts via SMS of problems. 11
  • 12.
    Conclusions • Great performance: • ~300 req/s, peaking at 400 req/s • Maximum 100 registrations per minute • Server load maximum 5. • Client is extremely happy with the sites. • Internally, node.js has now become our preferred environment for web application development. • Designers have taken very quickly to Jade and Stylus, and love using them. • As effective for developing website as with PHP even with the additional learning. • In the future leveraging more of the things node.js is best at. Real-time apps, etc. 12
  • 13.
    Fin Thanks for listening! @mikecronn 13