SlideShare a Scribd company logo
1 of 28
JavaScript Everywhere
            From Nose To Tail




            Carl Husselbee - Sensis
Cliffano Subagio (@cliffano) - Shine Technologies
Citysearch.com.au
New Platform

  Improved application performance
  Better memory usage
  Improved content publishing reliability
  Zero content duplication
  Improved user experience

(project is still ongoing...)
The Three Amigos



 +         +
One JavaScript To Rule Them All
In A Nutshell
CouchDB
         Document oriented

             Schema free

    Design document in JavaScript

        Incremental replication

              HTTP API
Document

Simply a JSON object
{
    "_id": "listing-123",
    "_rev": "D1C946B7",
    "business_name": "Wolfgang Puck",
    "desc": "Fine dining and casual dining...",
    "rating": 5,
    "city": "Melbourne"
}

Stays as JSON on all layers
Replication


 Content publishing - replication rule
 curl -X POST "http://host/_replicate"
 -d '{"source": "db-src", "target": "db-target", "continuous": true}'
 -H "Content-Type: application/json"

 Content indexing - continuous changes feed
 curl -X GET "http://host/db/_changes?feed=continuous&since=123"
Design Document
A simple map reduce
"views": {
   "melbourne_rating": {
     "map": function (doc) {
         if (doc.city === 'Melbourne') { emit(null, doc.rating); }
     },
     "reduce": function (key, values, rereduce) {
         return sum(values);
     }}}

Highly testable
Easy to mock up
Cradle


CouchDB client for Node.js
Uses CouchDB REST API
Asynchronous
Built-in caching
Node.js

          Server-side JavaScript


              Based on V8


             Single Threaded


            Non-blocking I/O
Single Threaded
No more thread deadlock
More predictable app server memory usage
Like Nginx vs Apache
Non-blocking I/O

I/O is expensive
Traditional web app wastes time on I/O
 // blocking                      // non-blocking
 var listings = db.getListings(); var callback = function
 render(listings);                (listings) {
                                      render(listings);
                                  }
                                  db.getListings(callback);


Node.js provides non-blocking API
The Callback Trap
Nested Callbacks
var util = require(‘util’), listingId = 'listing-123';
function commentsCb(err, result) {
   if (err) {
   } else {
       console.log('Comments: ' + util.inspect(result));
   }
}
function listingCb(err, result) {
   if (err) {
   } else {
       console.log('Listing: ' + util.inspect(result));
       db.getComments(listingId, commentsCb)
   }
}
db.getListing(listingId, listingCb);
A Better Way
Use control flow module
var async = require('async'), listingId = 'listing-123';
function getComments(cb) {
    db.getComments(listingId, cb);
}
function getListing(cb) {
    db.getListing(listingId, cb);
}
async.parallel({ comments: getComments, listing: getListing },
function (err, results) {
    // results gives { listing: listingResult, comments: commentsResult }
});

Lots of other solutions: TameJS, Step, Seq, etc
Async In A Loop

This looks innocent

for (var i = 0; i < 1000000; i++) {
   console.log('Meditate on this, you must!');
}
Async In A Loop


console.log is asynchronous
Node.js is faster than terminal display
Library Changes

Within the past one year:
 Homegrown web framework >> Express
 node-couch >> Cradle
 Various template engines >> Jazz
 Promises >> Callbacks + Async
Testing

Insanely fast even on slow PC
15,000 SLOC
100% test coverage
34 seconds
YUITest, JSCoverage, nodelint
Homegrown Modules
Jazz - template engine
{foreach doc in widget.docs}
   {if (doc.type eq 'video')}
       <span><a href="{doc.videourl}">{doc.title}</a></span>
   {else}
       <a href="{helper.createUrl(doc.key)}">
          <h3>{doc.title}</h3>
       </a>
   {end}
{end}

No business logic
Synchronous compilation, asynchronous evalua
More Homegrown Modules


Log4js-node - logging framework
Severity level and rolling log file
Couchtato - CouchDB document utility tool
Doesn’t require CouchDB design doc knowledge
Continuous Integration


 Jenkins Node.js Plugin
 Nestor - Jenkins Node.js CLI
Conclusion




      CouchDB rocks! Node.js rocks!
       JavaScript web stack rocks!
Questions?
Resources
CouchDB - http://couchdb.apache.org

Node.js - http://nodejs.org

Jazz - http://github.com/shinetech/jazz

log4js-node - http://github.com/csausdev/log4js-node

Couchtato - http://github.com/cliffano/couchtato

Jenkins Node.js Plugin - https://wiki.jenkins-ci.org/display/JENKINS/NodeJS
+Plugin

Nestor - http://github.com/cliffano/nestor
Credits


 http://www.flickr.com/photos/daveaustria/2654190796/ by Dave Austria

 http://www.flickr.com/photos/38485387@N02/3580728177/ by flickrfavorites

 http://www.housecontainer.nl/blog/about-me/127-dj-yoda-from-star-wars.html

 http://www.miccicohan.net/blog/studio-antics-and-of-coursethe-rolling-stones/

More Related Content

What's hot

AWS user group September 2017 - Rob Ribeiro "Seeking Solutions for Debugging ...
AWS user group September 2017 - Rob Ribeiro "Seeking Solutions for Debugging ...AWS user group September 2017 - Rob Ribeiro "Seeking Solutions for Debugging ...
AWS user group September 2017 - Rob Ribeiro "Seeking Solutions for Debugging ...AWS Chicago
 
Functional Web Development
Functional Web DevelopmentFunctional Web Development
Functional Web DevelopmentFITC
 
Going fullstack React(ive) - Paulo Lopes - Codemotion Amsterdam 2017
Going fullstack React(ive) - Paulo Lopes - Codemotion Amsterdam 2017Going fullstack React(ive) - Paulo Lopes - Codemotion Amsterdam 2017
Going fullstack React(ive) - Paulo Lopes - Codemotion Amsterdam 2017Codemotion
 
Event Loop in Javascript
Event Loop in JavascriptEvent Loop in Javascript
Event Loop in JavascriptDiptiGandhi4
 
Flask and Angular: An approach to build robust platforms
Flask and Angular:  An approach to build robust platformsFlask and Angular:  An approach to build robust platforms
Flask and Angular: An approach to build robust platformsAyush Sharma
 
«От экспериментов с инфраструктурой до внедрения в продакшен»​
«От экспериментов с инфраструктурой до внедрения в продакшен»​«От экспериментов с инфраструктурой до внедрения в продакшен»​
«От экспериментов с инфраструктурой до внедрения в продакшен»​FDConf
 
Google App Engine Developer - Day4
Google App Engine Developer - Day4Google App Engine Developer - Day4
Google App Engine Developer - Day4Simon Su
 
"Service Worker: Let Your Web App Feel Like a Native "
"Service Worker: Let Your Web App Feel Like a Native ""Service Worker: Let Your Web App Feel Like a Native "
"Service Worker: Let Your Web App Feel Like a Native "FDConf
 
Playing With Fire - An Introduction to Node.js
Playing With Fire - An Introduction to Node.jsPlaying With Fire - An Introduction to Node.js
Playing With Fire - An Introduction to Node.jsMike Hagedorn
 
Cutting Edge Data Processing with PHP & XQuery
Cutting Edge Data Processing with PHP & XQueryCutting Edge Data Processing with PHP & XQuery
Cutting Edge Data Processing with PHP & XQueryWilliam Candillon
 
Server Side Event Driven Programming
Server Side Event Driven ProgrammingServer Side Event Driven Programming
Server Side Event Driven ProgrammingKamal Hussain
 
Docker in Action
Docker in ActionDocker in Action
Docker in ActionSimon Su
 
Mssql to mysql - Anton Ivanov
Mssql to mysql - Anton IvanovMssql to mysql - Anton Ivanov
Mssql to mysql - Anton IvanovDrupalCamp Kyiv
 
Headless drupal + react js Oleksandr Linyvyi
Headless drupal + react js   Oleksandr LinyvyiHeadless drupal + react js   Oleksandr Linyvyi
Headless drupal + react js Oleksandr LinyvyiDrupalCamp Kyiv
 
OpenStreetMap is Data
OpenStreetMap is DataOpenStreetMap is Data
OpenStreetMap is Datamikel_maron
 
Scalable network applications, event-driven - Node JS
Scalable network applications, event-driven - Node JSScalable network applications, event-driven - Node JS
Scalable network applications, event-driven - Node JSCosmin Mereuta
 
[Kotlin Serverless 工作坊] 單元 3 - 實作 JSON API
[Kotlin Serverless 工作坊] 單元 3 - 實作 JSON API[Kotlin Serverless 工作坊] 單元 3 - 實作 JSON API
[Kotlin Serverless 工作坊] 單元 3 - 實作 JSON APIShengyou Fan
 
Umleitung: a tiny mochiweb/CouchDB app
Umleitung: a tiny mochiweb/CouchDB appUmleitung: a tiny mochiweb/CouchDB app
Umleitung: a tiny mochiweb/CouchDB appLenz Gschwendtner
 
LAMP Stack (Reloaded) - Infrastructure as Code with Terraform & Packer
LAMP Stack (Reloaded) - Infrastructure as Code with Terraform & PackerLAMP Stack (Reloaded) - Infrastructure as Code with Terraform & Packer
LAMP Stack (Reloaded) - Infrastructure as Code with Terraform & PackerJan-Christoph Küster
 

What's hot (20)

AWS user group September 2017 - Rob Ribeiro "Seeking Solutions for Debugging ...
AWS user group September 2017 - Rob Ribeiro "Seeking Solutions for Debugging ...AWS user group September 2017 - Rob Ribeiro "Seeking Solutions for Debugging ...
AWS user group September 2017 - Rob Ribeiro "Seeking Solutions for Debugging ...
 
Functional Web Development
Functional Web DevelopmentFunctional Web Development
Functional Web Development
 
Going fullstack React(ive) - Paulo Lopes - Codemotion Amsterdam 2017
Going fullstack React(ive) - Paulo Lopes - Codemotion Amsterdam 2017Going fullstack React(ive) - Paulo Lopes - Codemotion Amsterdam 2017
Going fullstack React(ive) - Paulo Lopes - Codemotion Amsterdam 2017
 
Event Loop in Javascript
Event Loop in JavascriptEvent Loop in Javascript
Event Loop in Javascript
 
Flask and Angular: An approach to build robust platforms
Flask and Angular:  An approach to build robust platformsFlask and Angular:  An approach to build robust platforms
Flask and Angular: An approach to build robust platforms
 
«От экспериментов с инфраструктурой до внедрения в продакшен»​
«От экспериментов с инфраструктурой до внедрения в продакшен»​«От экспериментов с инфраструктурой до внедрения в продакшен»​
«От экспериментов с инфраструктурой до внедрения в продакшен»​
 
Google App Engine Developer - Day4
Google App Engine Developer - Day4Google App Engine Developer - Day4
Google App Engine Developer - Day4
 
"Service Worker: Let Your Web App Feel Like a Native "
"Service Worker: Let Your Web App Feel Like a Native ""Service Worker: Let Your Web App Feel Like a Native "
"Service Worker: Let Your Web App Feel Like a Native "
 
Playing With Fire - An Introduction to Node.js
Playing With Fire - An Introduction to Node.jsPlaying With Fire - An Introduction to Node.js
Playing With Fire - An Introduction to Node.js
 
Cutting Edge Data Processing with PHP & XQuery
Cutting Edge Data Processing with PHP & XQueryCutting Edge Data Processing with PHP & XQuery
Cutting Edge Data Processing with PHP & XQuery
 
Server Side Event Driven Programming
Server Side Event Driven ProgrammingServer Side Event Driven Programming
Server Side Event Driven Programming
 
Docker in Action
Docker in ActionDocker in Action
Docker in Action
 
Mssql to mysql - Anton Ivanov
Mssql to mysql - Anton IvanovMssql to mysql - Anton Ivanov
Mssql to mysql - Anton Ivanov
 
Headless drupal + react js Oleksandr Linyvyi
Headless drupal + react js   Oleksandr LinyvyiHeadless drupal + react js   Oleksandr Linyvyi
Headless drupal + react js Oleksandr Linyvyi
 
OpenStreetMap is Data
OpenStreetMap is DataOpenStreetMap is Data
OpenStreetMap is Data
 
Scalable network applications, event-driven - Node JS
Scalable network applications, event-driven - Node JSScalable network applications, event-driven - Node JS
Scalable network applications, event-driven - Node JS
 
[Kotlin Serverless 工作坊] 單元 3 - 實作 JSON API
[Kotlin Serverless 工作坊] 單元 3 - 實作 JSON API[Kotlin Serverless 工作坊] 單元 3 - 實作 JSON API
[Kotlin Serverless 工作坊] 單元 3 - 實作 JSON API
 
Umleitung: a tiny mochiweb/CouchDB app
Umleitung: a tiny mochiweb/CouchDB appUmleitung: a tiny mochiweb/CouchDB app
Umleitung: a tiny mochiweb/CouchDB app
 
LAMP Stack (Reloaded) - Infrastructure as Code with Terraform & Packer
LAMP Stack (Reloaded) - Infrastructure as Code with Terraform & PackerLAMP Stack (Reloaded) - Infrastructure as Code with Terraform & Packer
LAMP Stack (Reloaded) - Infrastructure as Code with Terraform & Packer
 
非同期javascriptの過去と未来
非同期javascriptの過去と未来非同期javascriptの過去と未来
非同期javascriptの過去と未来
 

Viewers also liked

5 Tips for Writing Better JavaScript
5 Tips for Writing Better JavaScript5 Tips for Writing Better JavaScript
5 Tips for Writing Better JavaScriptNael El Shawwa
 
Using Node.js for everything or what it is to write a book about it
Using Node.js for everything or what it is to write a book about itUsing Node.js for everything or what it is to write a book about it
Using Node.js for everything or what it is to write a book about itKrasimir Tsonev
 
Developing large scale JavaScript applications
Developing large scale JavaScript applicationsDeveloping large scale JavaScript applications
Developing large scale JavaScript applicationsMilan Korsos
 
jQquerysummit - Large-scale JavaScript Application Architecture
jQquerysummit - Large-scale JavaScript Application Architecture jQquerysummit - Large-scale JavaScript Application Architecture
jQquerysummit - Large-scale JavaScript Application Architecture Jiby John
 
Reactjs - the good, the bad and the ugly
Reactjs - the good, the bad and the uglyReactjs - the good, the bad and the ugly
Reactjs - the good, the bad and the uglyKrasimir Tsonev
 
Unidirectional data flow
Unidirectional data flowUnidirectional data flow
Unidirectional data flowDenis Gorbunov
 

Viewers also liked (7)

5 Tips for Writing Better JavaScript
5 Tips for Writing Better JavaScript5 Tips for Writing Better JavaScript
5 Tips for Writing Better JavaScript
 
Using Node.js for everything or what it is to write a book about it
Using Node.js for everything or what it is to write a book about itUsing Node.js for everything or what it is to write a book about it
Using Node.js for everything or what it is to write a book about it
 
Developing large scale JavaScript applications
Developing large scale JavaScript applicationsDeveloping large scale JavaScript applications
Developing large scale JavaScript applications
 
jQquerysummit - Large-scale JavaScript Application Architecture
jQquerysummit - Large-scale JavaScript Application Architecture jQquerysummit - Large-scale JavaScript Application Architecture
jQquerysummit - Large-scale JavaScript Application Architecture
 
Reactjs - the good, the bad and the ugly
Reactjs - the good, the bad and the uglyReactjs - the good, the bad and the ugly
Reactjs - the good, the bad and the ugly
 
Unidirectional data flow
Unidirectional data flowUnidirectional data flow
Unidirectional data flow
 
Modern Web Applications
Modern Web ApplicationsModern Web Applications
Modern Web Applications
 

Similar to Javascript Everywhere From Nose To Tail

Node js introduction
Node js introductionNode js introduction
Node js introductionAlex Su
 
Future Decoded - Node.js per sviluppatori .NET
Future Decoded - Node.js per sviluppatori .NETFuture Decoded - Node.js per sviluppatori .NET
Future Decoded - Node.js per sviluppatori .NETGianluca Carucci
 
Writing robust Node.js applications
Writing robust Node.js applicationsWriting robust Node.js applications
Writing robust Node.js applicationsTom Croucher
 
Quick and Easy Development with Node.js and Couchbase Server
Quick and Easy Development with Node.js and Couchbase ServerQuick and Easy Development with Node.js and Couchbase Server
Quick and Easy Development with Node.js and Couchbase ServerNic Raboy
 
Bonnes pratiques de développement avec Node js
Bonnes pratiques de développement avec Node jsBonnes pratiques de développement avec Node js
Bonnes pratiques de développement avec Node jsFrancois Zaninotto
 
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQuery
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQueryRemedie: Building a desktop app with HTTP::Engine, SQLite and jQuery
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQueryTatsuhiko Miyagawa
 
Full-Stack JavaScript with Node.js
Full-Stack JavaScript with Node.jsFull-Stack JavaScript with Node.js
Full-Stack JavaScript with Node.jsMichael Lehmann
 
Serverless in-action
Serverless in-actionServerless in-action
Serverless in-actionAssaf Gannon
 
Serverless archtiectures
Serverless archtiecturesServerless archtiectures
Serverless archtiecturesIegor Fadieiev
 
e-suap - client technologies- english version
e-suap - client technologies- english versione-suap - client technologies- english version
e-suap - client technologies- english versionSabino Labarile
 
How and why i roll my own node.js framework
How and why i roll my own node.js frameworkHow and why i roll my own node.js framework
How and why i roll my own node.js frameworkBen Lin
 
09 - express nodes on the right angle - vitaliy basyuk - it event 2013 (5)
09 - express nodes on the right angle - vitaliy basyuk - it event 2013 (5)09 - express nodes on the right angle - vitaliy basyuk - it event 2013 (5)
09 - express nodes on the right angle - vitaliy basyuk - it event 2013 (5)Igor Bronovskyy
 
Solutions for bi-directional Integration between Oracle RDMBS & Apache Kafka
Solutions for bi-directional Integration between Oracle RDMBS & Apache KafkaSolutions for bi-directional Integration between Oracle RDMBS & Apache Kafka
Solutions for bi-directional Integration between Oracle RDMBS & Apache KafkaGuido Schmutz
 
Solutions for bi-directional integration between Oracle RDBMS and Apache Kafk...
Solutions for bi-directional integration between Oracle RDBMS and Apache Kafk...Solutions for bi-directional integration between Oracle RDBMS and Apache Kafk...
Solutions for bi-directional integration between Oracle RDBMS and Apache Kafk...confluent
 
Data models in Angular 1 & 2
Data models in Angular 1 & 2Data models in Angular 1 & 2
Data models in Angular 1 & 2Adam Klein
 
Node js
Node jsNode js
Node jshazzaz
 

Similar to Javascript Everywhere From Nose To Tail (20)

NodeJS
NodeJSNodeJS
NodeJS
 
Node js introduction
Node js introductionNode js introduction
Node js introduction
 
Future Decoded - Node.js per sviluppatori .NET
Future Decoded - Node.js per sviluppatori .NETFuture Decoded - Node.js per sviluppatori .NET
Future Decoded - Node.js per sviluppatori .NET
 
Writing robust Node.js applications
Writing robust Node.js applicationsWriting robust Node.js applications
Writing robust Node.js applications
 
Quick and Easy Development with Node.js and Couchbase Server
Quick and Easy Development with Node.js and Couchbase ServerQuick and Easy Development with Node.js and Couchbase Server
Quick and Easy Development with Node.js and Couchbase Server
 
Bonnes pratiques de développement avec Node js
Bonnes pratiques de développement avec Node jsBonnes pratiques de développement avec Node js
Bonnes pratiques de développement avec Node js
 
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQuery
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQueryRemedie: Building a desktop app with HTTP::Engine, SQLite and jQuery
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQuery
 
Full-Stack JavaScript with Node.js
Full-Stack JavaScript with Node.jsFull-Stack JavaScript with Node.js
Full-Stack JavaScript with Node.js
 
Serverless in-action
Serverless in-actionServerless in-action
Serverless in-action
 
Serverless archtiectures
Serverless archtiecturesServerless archtiectures
Serverless archtiectures
 
e-suap - client technologies- english version
e-suap - client technologies- english versione-suap - client technologies- english version
e-suap - client technologies- english version
 
How and why i roll my own node.js framework
How and why i roll my own node.js frameworkHow and why i roll my own node.js framework
How and why i roll my own node.js framework
 
AngularJS and SPA
AngularJS and SPAAngularJS and SPA
AngularJS and SPA
 
09 - express nodes on the right angle - vitaliy basyuk - it event 2013 (5)
09 - express nodes on the right angle - vitaliy basyuk - it event 2013 (5)09 - express nodes on the right angle - vitaliy basyuk - it event 2013 (5)
09 - express nodes on the right angle - vitaliy basyuk - it event 2013 (5)
 
Solutions for bi-directional Integration between Oracle RDMBS & Apache Kafka
Solutions for bi-directional Integration between Oracle RDMBS & Apache KafkaSolutions for bi-directional Integration between Oracle RDMBS & Apache Kafka
Solutions for bi-directional Integration between Oracle RDMBS & Apache Kafka
 
Solutions for bi-directional integration between Oracle RDBMS and Apache Kafk...
Solutions for bi-directional integration between Oracle RDBMS and Apache Kafk...Solutions for bi-directional integration between Oracle RDBMS and Apache Kafk...
Solutions for bi-directional integration between Oracle RDBMS and Apache Kafk...
 
Data models in Angular 1 & 2
Data models in Angular 1 & 2Data models in Angular 1 & 2
Data models in Angular 1 & 2
 
Node js
Node jsNode js
Node js
 
NodeJS for Beginner
NodeJS for BeginnerNodeJS for Beginner
NodeJS for Beginner
 
Couchbas for dummies
Couchbas for dummiesCouchbas for dummies
Couchbas for dummies
 

More from Cliffano Subagio

Cross-Workloads Resource-Level Relationship in AWS
Cross-Workloads Resource-Level Relationship in AWSCross-Workloads Resource-Level Relationship in AWS
Cross-Workloads Resource-Level Relationship in AWSCliffano Subagio
 
AEM OpenCloud Delivery Practices
AEM OpenCloud Delivery PracticesAEM OpenCloud Delivery Practices
AEM OpenCloud Delivery PracticesCliffano Subagio
 
OpenAPI Generator The Babel Fish of The API World - apidays Live Paris
OpenAPI Generator The Babel Fish of The API World - apidays Live ParisOpenAPI Generator The Babel Fish of The API World - apidays Live Paris
OpenAPI Generator The Babel Fish of The API World - apidays Live ParisCliffano Subagio
 
OpenAPI Generator The Babel Fish of The API World - apidays Live Australia
OpenAPI Generator The Babel Fish of The API World - apidays Live AustraliaOpenAPI Generator The Babel Fish of The API World - apidays Live Australia
OpenAPI Generator The Babel Fish of The API World - apidays Live AustraliaCliffano Subagio
 
A Journey to Improve Infrastructure Compliance With InSpec
A Journey to Improve Infrastructure Compliance With InSpecA Journey to Improve Infrastructure Compliance With InSpec
A Journey to Improve Infrastructure Compliance With InSpecCliffano Subagio
 
How to Fit an Infrastructure Platform into Multiple Enterprise Environments
How to Fit an Infrastructure Platform into Multiple Enterprise EnvironmentsHow to Fit an Infrastructure Platform into Multiple Enterprise Environments
How to Fit an Infrastructure Platform into Multiple Enterprise EnvironmentsCliffano Subagio
 
Swagger AEM - An OpenAPI Specification for AEM
Swagger AEM - An OpenAPI Specification for AEMSwagger AEM - An OpenAPI Specification for AEM
Swagger AEM - An OpenAPI Specification for AEMCliffano Subagio
 
A Quick Look at Accessibility in the World of DevOps
A Quick Look at Accessibility in the World of DevOpsA Quick Look at Accessibility in the World of DevOps
A Quick Look at Accessibility in the World of DevOpsCliffano Subagio
 
Conversation With Your Application Using DialogFlow and CloudFunctions
Conversation With Your Application Using DialogFlow and CloudFunctionsConversation With Your Application Using DialogFlow and CloudFunctions
Conversation With Your Application Using DialogFlow and CloudFunctionsCliffano Subagio
 
Let's Build Voice Assistant Learning Games For Kids
Let's Build Voice Assistant Learning Games For KidsLet's Build Voice Assistant Learning Games For Kids
Let's Build Voice Assistant Learning Games For KidsCliffano Subagio
 
Having A Talk With Jenkins
Having A Talk With JenkinsHaving A Talk With Jenkins
Having A Talk With JenkinsCliffano Subagio
 
AEM Open Cloud - The First Two Years
AEM Open Cloud - The First Two YearsAEM Open Cloud - The First Two Years
AEM Open Cloud - The First Two YearsCliffano Subagio
 
AEM OpenCloud - What's New Since 2.0.0
AEM OpenCloud - What's New Since 2.0.0AEM OpenCloud - What's New Since 2.0.0
AEM OpenCloud - What's New Since 2.0.0Cliffano Subagio
 
Open Source AEM Platform: A Short Intro
Open Source AEM Platform: A Short IntroOpen Source AEM Platform: A Short Intro
Open Source AEM Platform: A Short IntroCliffano Subagio
 
How To Play Music On A Vacuum Cleaner
How To Play Music On A Vacuum CleanerHow To Play Music On A Vacuum Cleaner
How To Play Music On A Vacuum CleanerCliffano Subagio
 
Bringing Jenkins Remote Access API To The Masses
Bringing Jenkins Remote Access API To The MassesBringing Jenkins Remote Access API To The Masses
Bringing Jenkins Remote Access API To The MassesCliffano Subagio
 
Application Deployment Using Ansible
Application Deployment Using AnsibleApplication Deployment Using Ansible
Application Deployment Using AnsibleCliffano Subagio
 

More from Cliffano Subagio (20)

Cross-Workloads Resource-Level Relationship in AWS
Cross-Workloads Resource-Level Relationship in AWSCross-Workloads Resource-Level Relationship in AWS
Cross-Workloads Resource-Level Relationship in AWS
 
AEM OpenCloud Delivery Practices
AEM OpenCloud Delivery PracticesAEM OpenCloud Delivery Practices
AEM OpenCloud Delivery Practices
 
OpenAPI Generator The Babel Fish of The API World - apidays Live Paris
OpenAPI Generator The Babel Fish of The API World - apidays Live ParisOpenAPI Generator The Babel Fish of The API World - apidays Live Paris
OpenAPI Generator The Babel Fish of The API World - apidays Live Paris
 
OpenAPI Generator The Babel Fish of The API World - apidays Live Australia
OpenAPI Generator The Babel Fish of The API World - apidays Live AustraliaOpenAPI Generator The Babel Fish of The API World - apidays Live Australia
OpenAPI Generator The Babel Fish of The API World - apidays Live Australia
 
A Journey to Improve Infrastructure Compliance With InSpec
A Journey to Improve Infrastructure Compliance With InSpecA Journey to Improve Infrastructure Compliance With InSpec
A Journey to Improve Infrastructure Compliance With InSpec
 
How to Fit an Infrastructure Platform into Multiple Enterprise Environments
How to Fit an Infrastructure Platform into Multiple Enterprise EnvironmentsHow to Fit an Infrastructure Platform into Multiple Enterprise Environments
How to Fit an Infrastructure Platform into Multiple Enterprise Environments
 
Swagger AEM - An OpenAPI Specification for AEM
Swagger AEM - An OpenAPI Specification for AEMSwagger AEM - An OpenAPI Specification for AEM
Swagger AEM - An OpenAPI Specification for AEM
 
Introducing AEM OpenCloud
Introducing AEM OpenCloudIntroducing AEM OpenCloud
Introducing AEM OpenCloud
 
A Quick Look at Accessibility in the World of DevOps
A Quick Look at Accessibility in the World of DevOpsA Quick Look at Accessibility in the World of DevOps
A Quick Look at Accessibility in the World of DevOps
 
Conversation With Your Application Using DialogFlow and CloudFunctions
Conversation With Your Application Using DialogFlow and CloudFunctionsConversation With Your Application Using DialogFlow and CloudFunctions
Conversation With Your Application Using DialogFlow and CloudFunctions
 
Let's Build Voice Assistant Learning Games For Kids
Let's Build Voice Assistant Learning Games For KidsLet's Build Voice Assistant Learning Games For Kids
Let's Build Voice Assistant Learning Games For Kids
 
Having A Talk With Jenkins
Having A Talk With JenkinsHaving A Talk With Jenkins
Having A Talk With Jenkins
 
AEM Open Cloud - The First Two Years
AEM Open Cloud - The First Two YearsAEM Open Cloud - The First Two Years
AEM Open Cloud - The First Two Years
 
AEM OpenCloud - What's New Since 2.0.0
AEM OpenCloud - What's New Since 2.0.0AEM OpenCloud - What's New Since 2.0.0
AEM OpenCloud - What's New Since 2.0.0
 
Beyond AEM Curl Commands
Beyond AEM Curl CommandsBeyond AEM Curl Commands
Beyond AEM Curl Commands
 
AEM OpenCloud
AEM OpenCloudAEM OpenCloud
AEM OpenCloud
 
Open Source AEM Platform: A Short Intro
Open Source AEM Platform: A Short IntroOpen Source AEM Platform: A Short Intro
Open Source AEM Platform: A Short Intro
 
How To Play Music On A Vacuum Cleaner
How To Play Music On A Vacuum CleanerHow To Play Music On A Vacuum Cleaner
How To Play Music On A Vacuum Cleaner
 
Bringing Jenkins Remote Access API To The Masses
Bringing Jenkins Remote Access API To The MassesBringing Jenkins Remote Access API To The Masses
Bringing Jenkins Remote Access API To The Masses
 
Application Deployment Using Ansible
Application Deployment Using AnsibleApplication Deployment Using Ansible
Application Deployment Using Ansible
 

Recently uploaded

Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesrafiqahmad00786416
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Victor Rentea
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWERMadyBayot
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024The Digital Insurer
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024The Digital Insurer
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdfSandro Moreira
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...apidays
 

Recently uploaded (20)

Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 

Javascript Everywhere From Nose To Tail

  • 1. JavaScript Everywhere From Nose To Tail Carl Husselbee - Sensis Cliffano Subagio (@cliffano) - Shine Technologies
  • 3. New Platform Improved application performance Better memory usage Improved content publishing reliability Zero content duplication Improved user experience (project is still ongoing...)
  • 5. One JavaScript To Rule Them All
  • 7. CouchDB Document oriented Schema free Design document in JavaScript Incremental replication HTTP API
  • 8. Document Simply a JSON object { "_id": "listing-123", "_rev": "D1C946B7", "business_name": "Wolfgang Puck", "desc": "Fine dining and casual dining...", "rating": 5, "city": "Melbourne" } Stays as JSON on all layers
  • 9. Replication Content publishing - replication rule curl -X POST "http://host/_replicate" -d '{"source": "db-src", "target": "db-target", "continuous": true}' -H "Content-Type: application/json" Content indexing - continuous changes feed curl -X GET "http://host/db/_changes?feed=continuous&since=123"
  • 10. Design Document A simple map reduce "views": { "melbourne_rating": { "map": function (doc) { if (doc.city === 'Melbourne') { emit(null, doc.rating); } }, "reduce": function (key, values, rereduce) { return sum(values); }}} Highly testable Easy to mock up
  • 11. Cradle CouchDB client for Node.js Uses CouchDB REST API Asynchronous Built-in caching
  • 12. Node.js Server-side JavaScript Based on V8 Single Threaded Non-blocking I/O
  • 13. Single Threaded No more thread deadlock More predictable app server memory usage Like Nginx vs Apache
  • 14. Non-blocking I/O I/O is expensive Traditional web app wastes time on I/O // blocking // non-blocking var listings = db.getListings(); var callback = function render(listings); (listings) { render(listings); } db.getListings(callback); Node.js provides non-blocking API
  • 16. Nested Callbacks var util = require(‘util’), listingId = 'listing-123'; function commentsCb(err, result) { if (err) { } else { console.log('Comments: ' + util.inspect(result)); } } function listingCb(err, result) { if (err) { } else { console.log('Listing: ' + util.inspect(result)); db.getComments(listingId, commentsCb) } } db.getListing(listingId, listingCb);
  • 17. A Better Way Use control flow module var async = require('async'), listingId = 'listing-123'; function getComments(cb) { db.getComments(listingId, cb); } function getListing(cb) { db.getListing(listingId, cb); } async.parallel({ comments: getComments, listing: getListing }, function (err, results) { // results gives { listing: listingResult, comments: commentsResult } }); Lots of other solutions: TameJS, Step, Seq, etc
  • 18. Async In A Loop This looks innocent for (var i = 0; i < 1000000; i++) { console.log('Meditate on this, you must!'); }
  • 19. Async In A Loop console.log is asynchronous Node.js is faster than terminal display
  • 20. Library Changes Within the past one year: Homegrown web framework >> Express node-couch >> Cradle Various template engines >> Jazz Promises >> Callbacks + Async
  • 21. Testing Insanely fast even on slow PC 15,000 SLOC 100% test coverage 34 seconds YUITest, JSCoverage, nodelint
  • 22. Homegrown Modules Jazz - template engine {foreach doc in widget.docs} {if (doc.type eq 'video')} <span><a href="{doc.videourl}">{doc.title}</a></span> {else} <a href="{helper.createUrl(doc.key)}"> <h3>{doc.title}</h3> </a> {end} {end} No business logic Synchronous compilation, asynchronous evalua
  • 23. More Homegrown Modules Log4js-node - logging framework Severity level and rolling log file Couchtato - CouchDB document utility tool Doesn’t require CouchDB design doc knowledge
  • 24. Continuous Integration Jenkins Node.js Plugin Nestor - Jenkins Node.js CLI
  • 25. Conclusion CouchDB rocks! Node.js rocks! JavaScript web stack rocks!
  • 27. Resources CouchDB - http://couchdb.apache.org Node.js - http://nodejs.org Jazz - http://github.com/shinetech/jazz log4js-node - http://github.com/csausdev/log4js-node Couchtato - http://github.com/cliffano/couchtato Jenkins Node.js Plugin - https://wiki.jenkins-ci.org/display/JENKINS/NodeJS +Plugin Nestor - http://github.com/cliffano/nestor
  • 28. Credits http://www.flickr.com/photos/daveaustria/2654190796/ by Dave Austria http://www.flickr.com/photos/38485387@N02/3580728177/ by flickrfavorites http://www.housecontainer.nl/blog/about-me/127-dj-yoda-from-star-wars.html http://www.miccicohan.net/blog/studio-antics-and-of-coursethe-rolling-stones/

Editor's Notes

  1. \n
  2. \n
  3. \n
  4. \n
  5. \n
  6. \n
  7. \n
  8. \n
  9. \n
  10. \n
  11. \n
  12. \n
  13. \n
  14. \n
  15. \n
  16. \n
  17. \n
  18. \n
  19. \n
  20. \n
  21. \n
  22. \n
  23. \n
  24. \n
  25. \n
  26. \n
  27. \n
  28. \n