Upload
mikecronn
View
2.451
Download
0
Embed Size (px)
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.
Citation preview
Tour credentials
1
Clock Limited
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.
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.
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.
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+).
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.
7
Software Architecture
• End-to-end JavaScript:
• jQuery
• Node.js
• MongoDB
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.
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
10
Hosting Platform
• Single KVM virtual machine per site.
• Quad-core recent Intel Xeons with 4GB RAM. • Ubuntu Linux 10.04 LTS.
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.
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.
@mikecronn
13
Fin
Thanks for listening!