2. Summary
● Frontend Development
– In the Past
– Today
● Node.js as an API shim
– The IE7 problem it solves
– The frontend-backend coupling problem
– Solution
● Node.js is everywhere
– The new Perl
– Swiss army knife of web development
– One step away from deployment
3. In The Past
● Java for minifying CSS files
● Ruby for compiling SASS into CSS files
● Tightly coupled backend and frontend
– Build process
– Deployment process
– API integration
4. Frontend Today
● Node.js is used for frontend builds:
– for every step of the build process
– for dependency management
– for compilation, pre-processing
– for minifying and even for macros
5. The Situation
● AngularJS Web App
● Frontend build process all using Node.js
● Backend REST API written in Java
● Migrated from Java Server Faces to decouple
frontend from backend
● Clients are big banks, financial firms
6. The IE problem
● Internet Explorer 7 has a small limit on HTTP
requests
● IE7: 2 max simultaneous
● Our client was using IE7
7. Frontend/Backend Decoupling
● Relying on backend API changes when there's
a backlog of other work.
● Backend Java responsibilities:
– Crawl for data from other databases
– Index the data
– Search the data
– Generate reports
● Frontend release schedule tied to backend
releases
8. Node.js as an API Shim
● Solution was Node.js api server shim
● Bundled 4+ requests data into one request
● Using expressjs (already used for local
development)
● Only required a frontend web app
deployment :-)
9. API Shims To Sneak Node In
● Make APIs cleaner than they usually would be
without modifying your frontend code
● Re-use API methods to reduce the # of
requests
● Prototype new functionality quickly and then
backport to the backend
10. Advantages of Node.js
● Same language as the web browser scripting
language
● Asynchronous by default
● Process-oriented vs thread-oriented
● Fast compared to other dynamic languages
11. Node.js is the new Perl
● Text processing was a big part of web
development, especially for system
administration
● Perl was fast, flexible and supported crazy
regular expressions
● Web dev and devops requires inter-operation
with speed and scalability.
● Node.js is fast, flexible and supports crazy
asynchronous expressions
12. Most important fact about Node.js
● You do not need permission to use it
● Chances are it's already used for building and
deploying your frontend web app
● It's already installed, you're already
downloading packages for it
● You can write small command line scripts
● JSON is the language of APIs
13. Thanks!
● Check out my blogs
– http://neverfriday.com/
– http://sourcecontribute.com/
● Twitter: @src_contribute