Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Zero-downtime Javascript App Deployment

Zero-downtime Javascript App Deployment

This talk is inspired by @lukemelia's talk at RailsConf. It expands on his idea and uses native Javascript tooling. It also explores deploying multiple JS apps with a single backend as well as A/B testing and feature toggling.

Feifan Wang

August 26, 2014
Tweet

More Decks by Feifan Wang

Other Decks in Programming

Transcript

  1. Dev or CI Rails Server Static Assets Server
 (S3) CDN


    (CloudFront) Redis Deploy index.html Deploy Rails app Serve HTML Deploy JS, CSS, Static Assets Browser index.html,
 API Requests JS app,
 assets
  2. Deploy Key • frontend_deploy.yml • Passed in via query params


    example.com?deploy=88667 • Semantic flags
 example.com?deploy=canary
  3. Deploying to production • Get deploy key - current timestamp

    • Build the project
 ember build --environment=production • Insert deploy key into CDN url • Upload to S3 • Upload index.html to Redis
  4. GET / 1234:index.html Main JS App Main JS App admin:1255:index.html

    Admin JS App GET /Admin Admin JS App Access Parent App Admin Engine
  5. 1234:index.html Main JS App admin:1255:index.html Admin JS App Access Parent

    App Admin Engine API Server Developer(s) Developer(s) Developer(s) JS App
  6. GET / GET / Main JS App Main JS App

    Inject variables into the app
 (A/B, Feature Toggle)