how we scaled front end development - practical lessons on scaling js apps

46
How We Scaled Front End Development Practical Lessons on Scaling JS Apps Praveen Selvam

Upload: praveen-selvam

Post on 10-Jun-2015

575 views

Category:

Technology


0 download

DESCRIPTION

Every few days, a cool new library makes its way into the world of front end development. While every library has something interesting to offer, the practical question every front end developer has to answer is how well it weaves into the JS stack used by the existing apps. To add to it, the continuous evolution of these libraries only complicates the problem further. The past year saw an extensive growth in the space of what we call “Front End Ops”, where tools such as Gulp, Bower, Yeoman, etc. have been key in moving a lot of automated work into JS, that previously used to be solved using Ruby, Python, or similar scripting solutions. In this talk, I will use our startup story as a backbone to elicit the various techniques, principles and strategies we used to conceptualize, build, and ship our JS apps. Of course, the challenges are included as well!

TRANSCRIPT

Page 1: How we scaled front end development - Practical Lessons on Scaling JS Apps

How We ScaledFront End DevelopmentPractical Lessons on Scaling JS Apps

Praveen Selvam

Page 2: How we scaled front end development - Practical Lessons on Scaling JS Apps

The Indix Story

2012 2013 2014

$

Everything about Prices Everything about Products Scale & Velocity

$4.5MSeries A

$9MSeries A1

Page 3: How we scaled front end development - Practical Lessons on Scaling JS Apps

Indix - Today

450M+Product URLs

Data

Team

1500+Stores

42K+Brands

4 TBData in / day

2Countries

60Employees

30Engineers

Page 4: How we scaled front end development - Practical Lessons on Scaling JS Apps

The Indix JS Story

Year 1 Year 2 Year 3

Rapid prototyping

Build, Scrap, Repeat...

Optimize and Stabilize Scale, Productivity,Real User Monitoring

One app to many

Page 5: How we scaled front end development - Practical Lessons on Scaling JS Apps

Build

ScrapRepeat

Year 1

Rapid Prototyping

Page 6: How we scaled front end development - Practical Lessons on Scaling JS Apps

Inventing new stuffEffectiveness of product value

Engineering velocityAdaptability to changeFunctional coveragePresentable software

Why?

Aesthetics / UsabilityStability

PerformanceMetrics / MonitoringAutomated testing

Extreme focus on... Less importance for...

Page 7: How we scaled front end development - Practical Lessons on Scaling JS Apps

Templating:

Behaviour:

Data Mashup:

Tooling choices - “Simple”

960.gsjQuery + UIPlay / Rails

Page 8: How we scaled front end development - Practical Lessons on Scaling JS Apps

Year 2

Optimize and Stabilize

Enter the market quickly

Page 9: How we scaled front end development - Practical Lessons on Scaling JS Apps

Metrics / MonitoringFully automated testing

Dependency managementShared knowledge of code

Being production readyAesthetics / Usability

Stability & PerformanceEarly customer feedbackSome automated testing

Why?

Extreme focus on... Less importance for...

Page 10: How we scaled front end development - Practical Lessons on Scaling JS Apps

Templating:

Behaviour:

Asset packaging:

Data Mashup:

Caching:

Tooling choices - “Strategic”

Twitter BootstrapBackboneRailsRailsnginx

Page 11: How we scaled front end development - Practical Lessons on Scaling JS Apps

Benefits

● Bootstrapo Community tested templates & components

● Backboneo Adapters for external librarieso UI Routing - Drives the right abstraction

● Rails o Out of the box solutions

Page 12: How we scaled front end development - Practical Lessons on Scaling JS Apps

Major Challenge

Doing things in parallel

Customer version vs Development version

Managing dependenciesas the code grows

Page 13: How we scaled front end development - Practical Lessons on Scaling JS Apps

Customer version vs Development version

Feature flags

Page 14: How we scaled front end development - Practical Lessons on Scaling JS Apps

Customer version vs Development version

Branching

Frequent pulls from master into new branch

Keeping the branched time short

Page 15: How we scaled front end development - Practical Lessons on Scaling JS Apps

Managing dependencies as the code grows

Require.js + Rails Packaging

Require.js Rails Packaging

page1[needs]

mod1, mod2

sub_m1.js + sub_m2.js=

mod1_56789.js

Page 16: How we scaled front end development - Practical Lessons on Scaling JS Apps

Year 3

Scaling up as a team

Scale Productivity Real User Monitoring

One App to many Apps

Page 17: How we scaled front end development - Practical Lessons on Scaling JS Apps

Managing Scale

Larger / untidy code base=

Slower progress

Page 18: How we scaled front end development - Practical Lessons on Scaling JS Apps

Managing Scale

Keeping things in place

Using coveragefor cleanupFeature flag maintenanceRefactoring

Page 19: How we scaled front end development - Practical Lessons on Scaling JS Apps

Keeping things in place

CSS Usage

Page 20: How we scaled front end development - Practical Lessons on Scaling JS Apps

Keeping things in place

JSCoverage

Page 21: How we scaled front end development - Practical Lessons on Scaling JS Apps

Developer Productivity

Having more time

=

Scope for newer inventions

Page 22: How we scaled front end development - Practical Lessons on Scaling JS Apps

Developer Productivity

Core development activities

Page 23: How we scaled front end development - Practical Lessons on Scaling JS Apps

Developer Productivity

Yeoman

Page 24: How we scaled front end development - Practical Lessons on Scaling JS Apps

Developer Productivity

Yeoman

Page 25: How we scaled front end development - Practical Lessons on Scaling JS Apps

Developer Productivity

Grunt

Compilations LintingMinification

DocumentationDeployments and more...

Page 26: How we scaled front end development - Practical Lessons on Scaling JS Apps

Developer Productivity

Grunt

Source: Addy Osmani’s Presentation

gruntfile.js

Page 27: How we scaled front end development - Practical Lessons on Scaling JS Apps

Developer Productivity

Simpler Grunt Alternative

Page 28: How we scaled front end development - Practical Lessons on Scaling JS Apps

Developer Productivity

Bower

Page 29: How we scaled front end development - Practical Lessons on Scaling JS Apps

Developer Productivity

Bower

bower.json

Page 30: How we scaled front end development - Practical Lessons on Scaling JS Apps

Developer Productivity

Codekit

Page 31: How we scaled front end development - Practical Lessons on Scaling JS Apps

Developer Productivity

Alfred Workflows

Page 32: How we scaled front end development - Practical Lessons on Scaling JS Apps

Developer Productivity

Alfred Workflows

Page 33: How we scaled front end development - Practical Lessons on Scaling JS Apps

Real User Monitoring

Predictingdowntime

Reproducingcontext

Reaching outto Engineers

Page 34: How we scaled front end development - Practical Lessons on Scaling JS Apps

Predicting down time

Track client side issues

Page 35: How we scaled front end development - Practical Lessons on Scaling JS Apps

Predicting down time

NewRelic Dashboard

Page 36: How we scaled front end development - Practical Lessons on Scaling JS Apps

Predicting down time

Degradation signals

Page 37: How we scaled front end development - Practical Lessons on Scaling JS Apps

Predicting down time

Pingdom Transaction Checks

Page 38: How we scaled front end development - Practical Lessons on Scaling JS Apps

Reproducing context

Mixpanel Live Tracking

Page 39: How we scaled front end development - Practical Lessons on Scaling JS Apps

Reproducing context

Insights from Analytics

Page 40: How we scaled front end development - Practical Lessons on Scaling JS Apps

Reproducing context

Splunk Stacktraces

Page 41: How we scaled front end development - Practical Lessons on Scaling JS Apps

Reproducing context

SourceMaps

Page 42: How we scaled front end development - Practical Lessons on Scaling JS Apps

Reaching out to Engineers

PagerDuty

Page 43: How we scaled front end development - Practical Lessons on Scaling JS Apps

From One App to Multiple Apps

Standardizing UXDesign guidelines

IX LibraryCommon pieces of functionality

Page 44: How we scaled front end development - Practical Lessons on Scaling JS Apps

Recap

The Indix JS Story

Year 1 Year 2 Year 3

Rapid prototyping

Build, Scrap, Repeat...Optimize and Stabilize

Scale, Productivity,Real User Monitoring

One app to many

Twitter Bootstrap

Backbone

Rails

nginx

Feature Flags, Branching

Require.js

Coverage / Clean ups

Yeoman, Grunt, Bower

Codekit, Alfred

NewRelic, Pingdom

Mixpanel, Splunk, SourceMaps

PagerDuty

960.gs

jQuery + UI

Play / Rails

Page 45: How we scaled front end development - Practical Lessons on Scaling JS Apps

Key Learnings

Choose technologies wiselyBalance prototyping vs Being production ready

Stay up to dateBalance Customers vs Refactoring to absorb the best

technologies

Avoid disruptions to shipped products

Stay in control of products that’s shipped

Optimize your time and stay productive