cyber-duck node.js showcase

13
1 Clock Limited Node.js Showcase

Upload: mikecronn

Post on 01-Jul-2015

2.451 views

Category:

Technology


0 download

DESCRIPTION

Slides from my talk at the Cyber-Duck node.js Showcase, discussing Clock Limited's implementation of 2 large commercial web sites in node.js and MongoDB.

TRANSCRIPT

Page 1: Cyber-Duck node.js Showcase

Tour credentials

1

Clock Limited

Node.js Showcase

Page 2: Cyber-Duck node.js Showcase

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.

Page 3: Cyber-Duck node.js Showcase

3

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.

Page 4: Cyber-Duck node.js Showcase

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.

Page 5: Cyber-Duck node.js Showcase

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+).

Page 6: Cyber-Duck node.js Showcase

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.

Page 7: Cyber-Duck node.js Showcase

7

Software Architecture

• End-to-end JavaScript:

• jQuery

• Node.js

• MongoDB

Page 8: Cyber-Duck node.js Showcase

Node Application

Architecture

8

• Application built on Express framework.

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

• Jade and Stylus.

• Underscore; Formidable; gm; nodemailer.

Page 9: Cyber-Duck node.js Showcase

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

Page 10: Cyber-Duck node.js Showcase

10

Hosting Platform

• Single KVM virtual machine per site.

• Quad-core recent Intel Xeons with 4GB RAM. • Ubuntu Linux 10.04 LTS.

Page 11: Cyber-Duck node.js Showcase

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.

Page 12: Cyber-Duck node.js Showcase

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.

Page 13: Cyber-Duck node.js Showcase

@mikecronn

13

Fin

Thanks for listening!