SlideShare a Scribd company logo
1 of 22
PROGRAMMING PROXIES
TO DO WHAT WE NEED SO
WE DON'T HAVE TO TALK
TO THE NETWORK GUYS
AGAIN
@lmacvittie from @f5networks at #gluecon
Lori MacVittie
Sr. Product Manager, Emerging Technologies
F5 Networks
Deployment
patterns
WHY WOULD YOU NEED
TO TALK TO THE
NETWORK GUYS
ANYWAY?
@lmacvittie #gluecon
DEPLOYMENT PATTERNS USE LAYER 7 ROUTING
Canary Deployments Blue/Green Deployments
A/B Testing
v.1
v.2
v.3
API Management
Redirection Replication
(Dark Architecture)
@lmacvittie #gluecon
ROUTING IS A NETWORK THING
Router Switch FirewallDDoS Protection Load BalancingDNS
CORE NETWORK (SHARED)
THE NETWORK GUYS ARE GENERALLY RESPONSIBLE FOR LAYER 7 ROUTING
@lmacvittie #gluecon
THEY DON’T WANT YOU TOUCHING THEIR TOYS
@lmacvittie #gluecon
proxiesSO WHAT DO YOU DO?
@lmacvittie #gluecon
Go forward and
backwards.
PROXIES
A Reverse Proxy sits between the user and an
application and can do things like caching, load
balancing, and security on behalf of the app.
A Forward Proxy sits between the user and an
application and does things like caching and
stopping you from using Facebook at work.
Today we’re (mostly) talking about the Reverse kind of Proxy.
@lmacvittie #gluecon
Proxies are
application-
aware with
network chops.
They are fluent
in both the
language of
applications
and networks.
PROXIES
THIS IS WHERE NETWORK STUFFS LIVE
THIS IS WHERE PROXIES LIVE
THIS IS WHERE APPLICATIONS LIVE
DATA
NETWORK
TRANSPORT
SESSION
PRESENTATION
APPLICATION
MAC ADDRESS
IP ADDRESS
TCP
SOCKS
SSL
HTTP / SPDY
L2-3 SERVICES
L4-7 SERVICES
HTML JSON XMLCSS
@lmacvittie #gluecon
WEB SERVER
PROXY
MODEL
VERSUS
PROGRAMMABLE
PROXY
MODEL
Proxy
Code
Config
Web Server Proxy Model
Application Stuffs
Network Stuffs
Programmable Proxy Model
Proxy
Code
Config
Application Stuffs
Network Stuffs
@lmacvittie #gluecon
A programmable
proxy is a proxy
that lets you
write code that
interacts with
both application
and network
stuffs like load
balancing and
application (L7)
routing and
databases.
PROGRAMMABLE
PROXIES
var onRequest = function(request, response, next ) {
var cookie = new Cookies( request, response );
var bugz_login = cookie.get("Bugzilla_login");
if( !logged_in || !bugz_login ) {
vs_a.newRequest(request, response, next);
return;
}
connection.query('SELECT opt_in from abtest where
userid=' + bugz_login, function(err, rows, fields) {
if (err) throw err;
var opt_in = rows[0].opt_in;
if( !opt_in ) {
vs_a.newRequest(request, response, next);
return;
} else {
vs_b.newRequest(request, response, next);
return;
}
});
Bugzilla
Bugzilla-A
Bugzilla-B
APPLICATION
STUFFS
NETWORK
STUFFS
@lmacvittie #gluecon
Deployment
patterns with
programmable
proxies
EXAMPLES
@lmacvittie #gluecon
A/B TESTING
Devices
Internet
Service Pool A
Service Pool B
serverGroupA
serverGroupB
vs1
vs2
• Transparently direct users to either version “A” or version “B”
• Increase or decrease traffic to each version in an instant
• Customize the selection criteria to your needs with a short Node.js script
• Use resources like databases or web APIs as part of the decision
@lmacvittie #gluecon
MySQL
Database
var assert = require('assert');
var os = require('os');
var http = require('http');
var fpm = require('lrs/forwardProxyModule');
var vsm = require('lrs/virtualServerModule');
var mysql = require('mysql');
var Cookies = require('cookies');
var proxyhost = os.hostname();
var vs = vsm.find('Bugzilla');
var vs_a = vsm.find('Bugzilla-A');
var vs_b = vsm.find('Bugzilla-B');
var logged_in = false;
// Log to a database
var connection = mysql.createConnection({
host : '192.168.22.22',
user : ‘xxxx',
password : ‘yyyyyyyyy',
database : 'abtesting'
});
var onRequest = function(request, response, next ) {
var cookie = new Cookies( request, response );
var bugz_login = cookie.get("Bugzilla_login");
if( !logged_in || !bugz_login ) {
// Default action: Send to A
vs_a.newRequest(request, response, next);
return;
}
// Add the user to the database automatically if they don't already exist
connection.query('INSERT INTO abtest (userid, ip) select * FROM (SELECT ' +
bugz_login + ', "' + request.connection.remoteAddress + '") as tmp 
WHERE NOT EXISTS(SELECT userid from abtest where userid=' +
bugz_login + ')', function(err, rows, fields) {
if (err) throw err;
// Use the database to decide which server to send this request to
connection.query('SELECT opt_in from abtest where userid=' + bugz_login,
function(err, rows, fields) {
if (err) throw err;
var opt_in = rows[0].opt_in;
if( !opt_in ) { vs_a.newRequest(request, response, next);
return;
} else { vs_b.newRequest(request, response, next);
return;
}
});
});
};
// onRequest
var onExist = function(vs) {
if(vs.id == 'Bugzilla') {
vs.on('request', onRequest);
connection.connect();
logged_in = true;
setInterval(keepAlive, 60000);
}
};
vsm.on('exist', 'Bugzilla', onExist);
URI MANAGEMENT (REDIRECTION)
Devices
Internet
• Manage hundreds of redirects/rewrites
(www.example.com/app2  www.example.com/app/v2)
• Update redirects without incurring potential outages
• Turn over management to the business folks because updating http conf files
every other day isn’t exactly the job you signed up for @lmacvittie #gluecon
serverGroupA
serverGroupB
vs1
vs2
TRAFFIC REPLICATION
Devices
Internet
Production
Staging
serverGroupA
serverGroupB
LB
LB
• Selected requests are replicated to both environments
• Selection criteria can be custom logic or network or application variables
@lmacvittie #gluecon
TRAFFIC REPLICATION
Devices
Internet
Production
Staging
serverGroupA
serverGroupB
LB
LB
• Production response flows back to user immediately
• Staging response is blocked from clients
• Custom code can compare production and staging response, report errors,
slowness, etc. and can log for later analysis @lmacvittie #gluecon
function forwardRequest(request, response, next) {
"use strict";
var vsm = require('lrs/virtualServerModule');
var http = require('http');
var mgmt = require('lrs/managementRest');
function ReplicateTraffic(scenarioName, primaryVSName, secondaryPort) {
var self = this;
self.scenarioName = scenarioName;
self.primaryVS = primaryVSName;
self.port = secondaryPort;
//We need a secondary port that we expect is a loopback virtual IP that
//goes to the secondary virtual server
vsm.on('exist', primaryVSName, function(vs) {
vs.on('request', function(req, res, next) {
self.replicate(req, res, next);
});
});
}
ReplicateTraffic.prototype.cloneReq = function(req) {
var newReq = http.request({ host: "127.0.0.1",
port: this.port,
method: req.method,
path: req.url,
headers: req.headers},
function() {});
return newReq;
}
ReplicateTraffic.prototype.replicate = function(req, res, next) {
if(req.method == 'GET' || req.method == 'HEAD') {
// Only do GET and HEAD
var newReq = this.cloneReq(req);
// I want to do vsB.newRequest(newReq) but cannot
// so I loop it through a dummy vip in cloneReq
newReq.on('response', function(res)
{ console.log('saw B resp'); });
newReq.end();
}
next();
}
var repl = new ReplicateTraffic("xxx",
'vsAandB',
15000);
Network
stuffs
belong in
the network.
WHEN SHOULD I USE A
PROGRAMMABLE
PROXY?
@lmacvittie #gluecon
How to choose
between proxy
and app
NETWORK
STUFFS
• chooses an application instance based on HTTP header
• Content-type, URI, device (user-agent), API version, HTTP
CRUD operation, etc…
• chooses an application instance based on payload
• Value of a key in a JSON payload, XML element value,
HTML form data, etc…
• would force you to use an HTTP redirect
• Changing URLs
• Deprecated API calls
• is enforcing a quota (rate limiting) to avoid overwhelming
applications
• needs to do a network thing (e.g. app routing, load balancing,
service chaining) that requires application data from an
external source (database, API call, etc…)
Put the logic in a proxy if the logic ….
@lmacvittie #gluecon
Use
programmable
proxies to
implement
deployment
patterns that
require more
logic than basic
conditionals or
data from
external sources
DEVOPS
PATTERNS
@lmacvittie #gluecon
Canary Deployments
Blue/Green Deployments
A/B Testing
v.1
v.2
v.3
API Management
Redirection
Replication
(Dark Architecture)
If you can code
it, you can do it
(probably)
PROGRAMMABLE
PROXIES
More things you can do with a programmable proxy
Application
security
Broker
authentication
Identity
devices and
users
v1.04
API version
matching
Rate Limiting /
API quota
enforcement
@lmacvittie #gluecon
Programmability in the Network: Traffic Replication
Programmability in the Network: Canary Deployments
Programmability in the Network: Blue-Green Deployment Pattern
Devops.com - Code in Flight
Gluecon 2013 - Dark Architecture and How to Forklift Upgrade Your System
Dyn's CTO Cory von Wallenstein:
LineRate Proxy Download (https://linerate.f5.com/)
@lmacvittie #gluecon

More Related Content

What's hot

DevOps Pipelines and Metrics Driven Feedback Loops
DevOps Pipelines and Metrics Driven Feedback LoopsDevOps Pipelines and Metrics Driven Feedback Loops
DevOps Pipelines and Metrics Driven Feedback LoopsAndreas Grabner
 
Performance Metrics Driven CI/CD - Introduction to Continuous Innovation and ...
Performance Metrics Driven CI/CD - Introduction to Continuous Innovation and ...Performance Metrics Driven CI/CD - Introduction to Continuous Innovation and ...
Performance Metrics Driven CI/CD - Introduction to Continuous Innovation and ...Mike Villiger
 
How to explain DevOps to your mom
How to explain DevOps to your momHow to explain DevOps to your mom
How to explain DevOps to your momAndreas Grabner
 
Top Java Performance Problems and Metrics To Check in Your Pipeline
Top Java Performance Problems and Metrics To Check in Your PipelineTop Java Performance Problems and Metrics To Check in Your Pipeline
Top Java Performance Problems and Metrics To Check in Your PipelineAndreas Grabner
 
DOES SFO 2016 - Chris Fulton - CD for DBs
DOES SFO 2016 - Chris Fulton - CD for DBsDOES SFO 2016 - Chris Fulton - CD for DBs
DOES SFO 2016 - Chris Fulton - CD for DBsGene Kim
 
Metrics-driven Continuous Delivery
Metrics-driven Continuous DeliveryMetrics-driven Continuous Delivery
Metrics-driven Continuous DeliveryAndrew Phillips
 
DevOps Transformation at Dynatrace and with Dynatrace
DevOps Transformation at Dynatrace and with DynatraceDevOps Transformation at Dynatrace and with Dynatrace
DevOps Transformation at Dynatrace and with DynatraceAndreas Grabner
 
Using microsoft application insights to implement a build, measure, learn loop
Using microsoft application insights to implement a build, measure, learn loopUsing microsoft application insights to implement a build, measure, learn loop
Using microsoft application insights to implement a build, measure, learn loopMarcel de Vries
 
Metrics-Driven Devops: Delivering High Quality Software Faster!
Metrics-Driven Devops: Delivering High Quality Software Faster! Metrics-Driven Devops: Delivering High Quality Software Faster!
Metrics-Driven Devops: Delivering High Quality Software Faster! Dynatrace
 
Monitoring as a Self-Service in Atlassian DevOps Toolchain
Monitoring as a Self-Service in Atlassian DevOps ToolchainMonitoring as a Self-Service in Atlassian DevOps Toolchain
Monitoring as a Self-Service in Atlassian DevOps ToolchainAndreas Grabner
 
Micro Service – The New Architecture Paradigm
Micro Service – The New Architecture ParadigmMicro Service – The New Architecture Paradigm
Micro Service – The New Architecture ParadigmEberhard Wolff
 
Creating Event Driven Serverless Applications - Sandeep - Adobe - Serverless ...
Creating Event Driven Serverless Applications - Sandeep - Adobe - Serverless ...Creating Event Driven Serverless Applications - Sandeep - Adobe - Serverless ...
Creating Event Driven Serverless Applications - Sandeep - Adobe - Serverless ...CodeOps Technologies LLP
 
Managing the Continuous Delivery of Code to AWS Lambda
Managing the Continuous Delivery of Code to AWS LambdaManaging the Continuous Delivery of Code to AWS Lambda
Managing the Continuous Delivery of Code to AWS LambdaAmazon Web Services
 
DevOps for AI Apps
DevOps for AI AppsDevOps for AI Apps
DevOps for AI AppsRichin Jain
 
Four Practices to Fix Your Top .NET Performance Problems
Four Practices to Fix Your Top .NET Performance ProblemsFour Practices to Fix Your Top .NET Performance Problems
Four Practices to Fix Your Top .NET Performance ProblemsAndreas Grabner
 
FaaS or not to FaaS. Visible and invisible benefits of the Serverless paradig...
FaaS or not to FaaS. Visible and invisible benefits of the Serverless paradig...FaaS or not to FaaS. Visible and invisible benefits of the Serverless paradig...
FaaS or not to FaaS. Visible and invisible benefits of the Serverless paradig...Vadym Kazulkin
 
AI-Powered DevOps: Injecting Speed & Quality Across Verizon’s Cloud Pipelines
AI-Powered DevOps: Injecting Speed & Quality Across Verizon’s Cloud PipelinesAI-Powered DevOps: Injecting Speed & Quality Across Verizon’s Cloud Pipelines
AI-Powered DevOps: Injecting Speed & Quality Across Verizon’s Cloud PipelinesDynatrace
 
Revolutionize DevOps with ML capabilities. Introduction to Amazon CodeGuru an...
Revolutionize DevOps with ML capabilities. Introduction to Amazon CodeGuru an...Revolutionize DevOps with ML capabilities. Introduction to Amazon CodeGuru an...
Revolutionize DevOps with ML capabilities. Introduction to Amazon CodeGuru an...Vadym Kazulkin
 
NashTech - Azure Application Insights
NashTech - Azure Application InsightsNashTech - Azure Application Insights
NashTech - Azure Application InsightsPhi Huynh
 

What's hot (20)

DevOps Pipelines and Metrics Driven Feedback Loops
DevOps Pipelines and Metrics Driven Feedback LoopsDevOps Pipelines and Metrics Driven Feedback Loops
DevOps Pipelines and Metrics Driven Feedback Loops
 
Performance Metrics Driven CI/CD - Introduction to Continuous Innovation and ...
Performance Metrics Driven CI/CD - Introduction to Continuous Innovation and ...Performance Metrics Driven CI/CD - Introduction to Continuous Innovation and ...
Performance Metrics Driven CI/CD - Introduction to Continuous Innovation and ...
 
How to explain DevOps to your mom
How to explain DevOps to your momHow to explain DevOps to your mom
How to explain DevOps to your mom
 
Top Java Performance Problems and Metrics To Check in Your Pipeline
Top Java Performance Problems and Metrics To Check in Your PipelineTop Java Performance Problems and Metrics To Check in Your Pipeline
Top Java Performance Problems and Metrics To Check in Your Pipeline
 
DOES SFO 2016 - Chris Fulton - CD for DBs
DOES SFO 2016 - Chris Fulton - CD for DBsDOES SFO 2016 - Chris Fulton - CD for DBs
DOES SFO 2016 - Chris Fulton - CD for DBs
 
Metrics-driven Continuous Delivery
Metrics-driven Continuous DeliveryMetrics-driven Continuous Delivery
Metrics-driven Continuous Delivery
 
Cloud Networking
Cloud NetworkingCloud Networking
Cloud Networking
 
DevOps Transformation at Dynatrace and with Dynatrace
DevOps Transformation at Dynatrace and with DynatraceDevOps Transformation at Dynatrace and with Dynatrace
DevOps Transformation at Dynatrace and with Dynatrace
 
Using microsoft application insights to implement a build, measure, learn loop
Using microsoft application insights to implement a build, measure, learn loopUsing microsoft application insights to implement a build, measure, learn loop
Using microsoft application insights to implement a build, measure, learn loop
 
Metrics-Driven Devops: Delivering High Quality Software Faster!
Metrics-Driven Devops: Delivering High Quality Software Faster! Metrics-Driven Devops: Delivering High Quality Software Faster!
Metrics-Driven Devops: Delivering High Quality Software Faster!
 
Monitoring as a Self-Service in Atlassian DevOps Toolchain
Monitoring as a Self-Service in Atlassian DevOps ToolchainMonitoring as a Self-Service in Atlassian DevOps Toolchain
Monitoring as a Self-Service in Atlassian DevOps Toolchain
 
Micro Service – The New Architecture Paradigm
Micro Service – The New Architecture ParadigmMicro Service – The New Architecture Paradigm
Micro Service – The New Architecture Paradigm
 
Creating Event Driven Serverless Applications - Sandeep - Adobe - Serverless ...
Creating Event Driven Serverless Applications - Sandeep - Adobe - Serverless ...Creating Event Driven Serverless Applications - Sandeep - Adobe - Serverless ...
Creating Event Driven Serverless Applications - Sandeep - Adobe - Serverless ...
 
Managing the Continuous Delivery of Code to AWS Lambda
Managing the Continuous Delivery of Code to AWS LambdaManaging the Continuous Delivery of Code to AWS Lambda
Managing the Continuous Delivery of Code to AWS Lambda
 
DevOps for AI Apps
DevOps for AI AppsDevOps for AI Apps
DevOps for AI Apps
 
Four Practices to Fix Your Top .NET Performance Problems
Four Practices to Fix Your Top .NET Performance ProblemsFour Practices to Fix Your Top .NET Performance Problems
Four Practices to Fix Your Top .NET Performance Problems
 
FaaS or not to FaaS. Visible and invisible benefits of the Serverless paradig...
FaaS or not to FaaS. Visible and invisible benefits of the Serverless paradig...FaaS or not to FaaS. Visible and invisible benefits of the Serverless paradig...
FaaS or not to FaaS. Visible and invisible benefits of the Serverless paradig...
 
AI-Powered DevOps: Injecting Speed & Quality Across Verizon’s Cloud Pipelines
AI-Powered DevOps: Injecting Speed & Quality Across Verizon’s Cloud PipelinesAI-Powered DevOps: Injecting Speed & Quality Across Verizon’s Cloud Pipelines
AI-Powered DevOps: Injecting Speed & Quality Across Verizon’s Cloud Pipelines
 
Revolutionize DevOps with ML capabilities. Introduction to Amazon CodeGuru an...
Revolutionize DevOps with ML capabilities. Introduction to Amazon CodeGuru an...Revolutionize DevOps with ML capabilities. Introduction to Amazon CodeGuru an...
Revolutionize DevOps with ML capabilities. Introduction to Amazon CodeGuru an...
 
NashTech - Azure Application Insights
NashTech - Azure Application InsightsNashTech - Azure Application Insights
NashTech - Azure Application Insights
 

Similar to Programming proxies to do what we need so we don't have to talk to the network guys again

JavaFX Enterprise (JavaOne 2014)
JavaFX Enterprise (JavaOne 2014)JavaFX Enterprise (JavaOne 2014)
JavaFX Enterprise (JavaOne 2014)Hendrik Ebbers
 
"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
 
Real World Lessons on the Pain Points of Node.JS Application
Real World Lessons on the Pain Points of Node.JS ApplicationReal World Lessons on the Pain Points of Node.JS Application
Real World Lessons on the Pain Points of Node.JS ApplicationBen Hall
 
apidays LIVE Australia - Building distributed systems on the shoulders of gia...
apidays LIVE Australia - Building distributed systems on the shoulders of gia...apidays LIVE Australia - Building distributed systems on the shoulders of gia...
apidays LIVE Australia - Building distributed systems on the shoulders of gia...apidays
 
Resilient and Adaptable Systems with Cloud Native APIs
Resilient and Adaptable Systems with Cloud Native APIsResilient and Adaptable Systems with Cloud Native APIs
Resilient and Adaptable Systems with Cloud Native APIsVMware Tanzu
 
From Web App Model Design to Production with Wakanda
From Web App Model Design to Production with WakandaFrom Web App Model Design to Production with Wakanda
From Web App Model Design to Production with WakandaAlexandre Morgaut
 
SMC304 Serverless Orchestration with AWS Step Functions
SMC304 Serverless Orchestration with AWS Step FunctionsSMC304 Serverless Orchestration with AWS Step Functions
SMC304 Serverless Orchestration with AWS Step FunctionsAmazon Web Services
 
Devfest 2023 - Service Weaver Introduction - Taipei.pdf
Devfest 2023 - Service Weaver Introduction - Taipei.pdfDevfest 2023 - Service Weaver Introduction - Taipei.pdf
Devfest 2023 - Service Weaver Introduction - Taipei.pdfKAI CHU CHUNG
 
Dropwizard Introduction
Dropwizard IntroductionDropwizard Introduction
Dropwizard IntroductionAnthony Chen
 
Full Stack Development With Node.Js And NoSQL (Nic Raboy & Arun Gupta)
Full Stack Development With Node.Js And NoSQL (Nic Raboy & Arun Gupta)Full Stack Development With Node.Js And NoSQL (Nic Raboy & Arun Gupta)
Full Stack Development With Node.Js And NoSQL (Nic Raboy & Arun Gupta)Red Hat Developers
 
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
 
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
 
Cannibalising The Google App Engine
Cannibalising The  Google  App  EngineCannibalising The  Google  App  Engine
Cannibalising The Google App Enginecatherinewall
 
Introduction to WAMP, a protocol enabling PUB/SUB and RPC over Websocket
Introduction to WAMP, a protocol enabling PUB/SUB and RPC over WebsocketIntroduction to WAMP, a protocol enabling PUB/SUB and RPC over Websocket
Introduction to WAMP, a protocol enabling PUB/SUB and RPC over Websocketsametmax
 
AWS Step Functions을 활용한 서버리스 앱 오케스트레이션
AWS Step Functions을 활용한 서버리스 앱 오케스트레이션AWS Step Functions을 활용한 서버리스 앱 오케스트레이션
AWS Step Functions을 활용한 서버리스 앱 오케스트레이션Amazon Web Services Korea
 
Building Scalable Stateless Applications with RxJava
Building Scalable Stateless Applications with RxJavaBuilding Scalable Stateless Applications with RxJava
Building Scalable Stateless Applications with RxJavaRick Warren
 
StrongLoop Overview
StrongLoop OverviewStrongLoop Overview
StrongLoop OverviewShubhra Kar
 
Writing robust Node.js applications
Writing robust Node.js applicationsWriting robust Node.js applications
Writing robust Node.js applicationsTom Croucher
 
using Mithril.js + postgREST to build and consume API's
using Mithril.js + postgREST to build and consume API'susing Mithril.js + postgREST to build and consume API's
using Mithril.js + postgREST to build and consume API'sAntônio Roberto Silva
 

Similar to Programming proxies to do what we need so we don't have to talk to the network guys again (20)

JavaFX Enterprise (JavaOne 2014)
JavaFX Enterprise (JavaOne 2014)JavaFX Enterprise (JavaOne 2014)
JavaFX Enterprise (JavaOne 2014)
 
"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 "
 
Real World Lessons on the Pain Points of Node.JS Application
Real World Lessons on the Pain Points of Node.JS ApplicationReal World Lessons on the Pain Points of Node.JS Application
Real World Lessons on the Pain Points of Node.JS Application
 
apidays LIVE Australia - Building distributed systems on the shoulders of gia...
apidays LIVE Australia - Building distributed systems on the shoulders of gia...apidays LIVE Australia - Building distributed systems on the shoulders of gia...
apidays LIVE Australia - Building distributed systems on the shoulders of gia...
 
Serverless Apps with AWS Step Functions
Serverless Apps with AWS Step FunctionsServerless Apps with AWS Step Functions
Serverless Apps with AWS Step Functions
 
Resilient and Adaptable Systems with Cloud Native APIs
Resilient and Adaptable Systems with Cloud Native APIsResilient and Adaptable Systems with Cloud Native APIs
Resilient and Adaptable Systems with Cloud Native APIs
 
From Web App Model Design to Production with Wakanda
From Web App Model Design to Production with WakandaFrom Web App Model Design to Production with Wakanda
From Web App Model Design to Production with Wakanda
 
SMC304 Serverless Orchestration with AWS Step Functions
SMC304 Serverless Orchestration with AWS Step FunctionsSMC304 Serverless Orchestration with AWS Step Functions
SMC304 Serverless Orchestration with AWS Step Functions
 
Devfest 2023 - Service Weaver Introduction - Taipei.pdf
Devfest 2023 - Service Weaver Introduction - Taipei.pdfDevfest 2023 - Service Weaver Introduction - Taipei.pdf
Devfest 2023 - Service Weaver Introduction - Taipei.pdf
 
Dropwizard Introduction
Dropwizard IntroductionDropwizard Introduction
Dropwizard Introduction
 
Full Stack Development With Node.Js And NoSQL (Nic Raboy & Arun Gupta)
Full Stack Development With Node.Js And NoSQL (Nic Raboy & Arun Gupta)Full Stack Development With Node.Js And NoSQL (Nic Raboy & Arun Gupta)
Full Stack Development With Node.Js And NoSQL (Nic Raboy & Arun Gupta)
 
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
 
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
 
Cannibalising The Google App Engine
Cannibalising The  Google  App  EngineCannibalising The  Google  App  Engine
Cannibalising The Google App Engine
 
Introduction to WAMP, a protocol enabling PUB/SUB and RPC over Websocket
Introduction to WAMP, a protocol enabling PUB/SUB and RPC over WebsocketIntroduction to WAMP, a protocol enabling PUB/SUB and RPC over Websocket
Introduction to WAMP, a protocol enabling PUB/SUB and RPC over Websocket
 
AWS Step Functions을 활용한 서버리스 앱 오케스트레이션
AWS Step Functions을 활용한 서버리스 앱 오케스트레이션AWS Step Functions을 활용한 서버리스 앱 오케스트레이션
AWS Step Functions을 활용한 서버리스 앱 오케스트레이션
 
Building Scalable Stateless Applications with RxJava
Building Scalable Stateless Applications with RxJavaBuilding Scalable Stateless Applications with RxJava
Building Scalable Stateless Applications with RxJava
 
StrongLoop Overview
StrongLoop OverviewStrongLoop Overview
StrongLoop Overview
 
Writing robust Node.js applications
Writing robust Node.js applicationsWriting robust Node.js applications
Writing robust Node.js applications
 
using Mithril.js + postgREST to build and consume API's
using Mithril.js + postgREST to build and consume API'susing Mithril.js + postgREST to build and consume API's
using Mithril.js + postgREST to build and consume API's
 

More from Lori MacVittie

So you think you can scale containers
So you think you can scale containersSo you think you can scale containers
So you think you can scale containersLori MacVittie
 
State of Application Delivery 2017 - Cloud Insights
State of Application Delivery 2017 - Cloud Insights State of Application Delivery 2017 - Cloud Insights
State of Application Delivery 2017 - Cloud Insights Lori MacVittie
 
State of Application Delivery 2017 - DevOps Insights
State of Application Delivery 2017 - DevOps Insights State of Application Delivery 2017 - DevOps Insights
State of Application Delivery 2017 - DevOps Insights Lori MacVittie
 
So you think you can scale
So you think you can scaleSo you think you can scale
So you think you can scaleLori MacVittie
 
Beyond POLB (Plain Old Load Balancing)
Beyond POLB (Plain Old Load Balancing) Beyond POLB (Plain Old Load Balancing)
Beyond POLB (Plain Old Load Balancing) Lori MacVittie
 
Pushing the DevOps envelope into the network with microservices
Pushing the DevOps envelope into the network with microservicesPushing the DevOps envelope into the network with microservices
Pushing the DevOps envelope into the network with microservicesLori MacVittie
 
Architectural Patterns for Scaling Microservices and APIs - GlueCon 2015
Architectural Patterns for Scaling Microservices and APIs - GlueCon 2015Architectural Patterns for Scaling Microservices and APIs - GlueCon 2015
Architectural Patterns for Scaling Microservices and APIs - GlueCon 2015Lori MacVittie
 
The Internet of Security Things (A Story about Change)
The Internet of Security Things (A Story about Change) The Internet of Security Things (A Story about Change)
The Internet of Security Things (A Story about Change) Lori MacVittie
 
HTTP/2 Changes Everything
HTTP/2 Changes EverythingHTTP/2 Changes Everything
HTTP/2 Changes EverythingLori MacVittie
 
5 ways to use node.js in the network
5 ways to use node.js in the network5 ways to use node.js in the network
5 ways to use node.js in the networkLori MacVittie
 
What are Software Defined Application Services
What are Software Defined Application ServicesWhat are Software Defined Application Services
What are Software Defined Application ServicesLori MacVittie
 
Operationalize all the network things
Operationalize all the network thingsOperationalize all the network things
Operationalize all the network thingsLori MacVittie
 
Dynamic Infrastructure
Dynamic InfrastructureDynamic Infrastructure
Dynamic InfrastructureLori MacVittie
 
Nine Ways to Use Network-Side Scripting
Nine Ways to Use Network-Side ScriptingNine Ways to Use Network-Side Scripting
Nine Ways to Use Network-Side ScriptingLori MacVittie
 
Web 2 And Application Delivery Public
Web 2 And Application Delivery PublicWeb 2 And Application Delivery Public
Web 2 And Application Delivery PublicLori MacVittie
 

More from Lori MacVittie (15)

So you think you can scale containers
So you think you can scale containersSo you think you can scale containers
So you think you can scale containers
 
State of Application Delivery 2017 - Cloud Insights
State of Application Delivery 2017 - Cloud Insights State of Application Delivery 2017 - Cloud Insights
State of Application Delivery 2017 - Cloud Insights
 
State of Application Delivery 2017 - DevOps Insights
State of Application Delivery 2017 - DevOps Insights State of Application Delivery 2017 - DevOps Insights
State of Application Delivery 2017 - DevOps Insights
 
So you think you can scale
So you think you can scaleSo you think you can scale
So you think you can scale
 
Beyond POLB (Plain Old Load Balancing)
Beyond POLB (Plain Old Load Balancing) Beyond POLB (Plain Old Load Balancing)
Beyond POLB (Plain Old Load Balancing)
 
Pushing the DevOps envelope into the network with microservices
Pushing the DevOps envelope into the network with microservicesPushing the DevOps envelope into the network with microservices
Pushing the DevOps envelope into the network with microservices
 
Architectural Patterns for Scaling Microservices and APIs - GlueCon 2015
Architectural Patterns for Scaling Microservices and APIs - GlueCon 2015Architectural Patterns for Scaling Microservices and APIs - GlueCon 2015
Architectural Patterns for Scaling Microservices and APIs - GlueCon 2015
 
The Internet of Security Things (A Story about Change)
The Internet of Security Things (A Story about Change) The Internet of Security Things (A Story about Change)
The Internet of Security Things (A Story about Change)
 
HTTP/2 Changes Everything
HTTP/2 Changes EverythingHTTP/2 Changes Everything
HTTP/2 Changes Everything
 
5 ways to use node.js in the network
5 ways to use node.js in the network5 ways to use node.js in the network
5 ways to use node.js in the network
 
What are Software Defined Application Services
What are Software Defined Application ServicesWhat are Software Defined Application Services
What are Software Defined Application Services
 
Operationalize all the network things
Operationalize all the network thingsOperationalize all the network things
Operationalize all the network things
 
Dynamic Infrastructure
Dynamic InfrastructureDynamic Infrastructure
Dynamic Infrastructure
 
Nine Ways to Use Network-Side Scripting
Nine Ways to Use Network-Side ScriptingNine Ways to Use Network-Side Scripting
Nine Ways to Use Network-Side Scripting
 
Web 2 And Application Delivery Public
Web 2 And Application Delivery PublicWeb 2 And Application Delivery Public
Web 2 And Application Delivery Public
 

Recently uploaded

TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxBkGupta21
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 

Recently uploaded (20)

DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptx
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 

Programming proxies to do what we need so we don't have to talk to the network guys again

  • 1. PROGRAMMING PROXIES TO DO WHAT WE NEED SO WE DON'T HAVE TO TALK TO THE NETWORK GUYS AGAIN @lmacvittie from @f5networks at #gluecon Lori MacVittie Sr. Product Manager, Emerging Technologies F5 Networks
  • 2. Deployment patterns WHY WOULD YOU NEED TO TALK TO THE NETWORK GUYS ANYWAY? @lmacvittie #gluecon
  • 3. DEPLOYMENT PATTERNS USE LAYER 7 ROUTING Canary Deployments Blue/Green Deployments A/B Testing v.1 v.2 v.3 API Management Redirection Replication (Dark Architecture) @lmacvittie #gluecon
  • 4. ROUTING IS A NETWORK THING Router Switch FirewallDDoS Protection Load BalancingDNS CORE NETWORK (SHARED) THE NETWORK GUYS ARE GENERALLY RESPONSIBLE FOR LAYER 7 ROUTING @lmacvittie #gluecon
  • 5. THEY DON’T WANT YOU TOUCHING THEIR TOYS @lmacvittie #gluecon
  • 6. proxiesSO WHAT DO YOU DO? @lmacvittie #gluecon
  • 7. Go forward and backwards. PROXIES A Reverse Proxy sits between the user and an application and can do things like caching, load balancing, and security on behalf of the app. A Forward Proxy sits between the user and an application and does things like caching and stopping you from using Facebook at work. Today we’re (mostly) talking about the Reverse kind of Proxy. @lmacvittie #gluecon
  • 8. Proxies are application- aware with network chops. They are fluent in both the language of applications and networks. PROXIES THIS IS WHERE NETWORK STUFFS LIVE THIS IS WHERE PROXIES LIVE THIS IS WHERE APPLICATIONS LIVE DATA NETWORK TRANSPORT SESSION PRESENTATION APPLICATION MAC ADDRESS IP ADDRESS TCP SOCKS SSL HTTP / SPDY L2-3 SERVICES L4-7 SERVICES HTML JSON XMLCSS @lmacvittie #gluecon
  • 9. WEB SERVER PROXY MODEL VERSUS PROGRAMMABLE PROXY MODEL Proxy Code Config Web Server Proxy Model Application Stuffs Network Stuffs Programmable Proxy Model Proxy Code Config Application Stuffs Network Stuffs @lmacvittie #gluecon
  • 10. A programmable proxy is a proxy that lets you write code that interacts with both application and network stuffs like load balancing and application (L7) routing and databases. PROGRAMMABLE PROXIES var onRequest = function(request, response, next ) { var cookie = new Cookies( request, response ); var bugz_login = cookie.get("Bugzilla_login"); if( !logged_in || !bugz_login ) { vs_a.newRequest(request, response, next); return; } connection.query('SELECT opt_in from abtest where userid=' + bugz_login, function(err, rows, fields) { if (err) throw err; var opt_in = rows[0].opt_in; if( !opt_in ) { vs_a.newRequest(request, response, next); return; } else { vs_b.newRequest(request, response, next); return; } }); Bugzilla Bugzilla-A Bugzilla-B APPLICATION STUFFS NETWORK STUFFS @lmacvittie #gluecon
  • 12. A/B TESTING Devices Internet Service Pool A Service Pool B serverGroupA serverGroupB vs1 vs2 • Transparently direct users to either version “A” or version “B” • Increase or decrease traffic to each version in an instant • Customize the selection criteria to your needs with a short Node.js script • Use resources like databases or web APIs as part of the decision @lmacvittie #gluecon MySQL Database
  • 13. var assert = require('assert'); var os = require('os'); var http = require('http'); var fpm = require('lrs/forwardProxyModule'); var vsm = require('lrs/virtualServerModule'); var mysql = require('mysql'); var Cookies = require('cookies'); var proxyhost = os.hostname(); var vs = vsm.find('Bugzilla'); var vs_a = vsm.find('Bugzilla-A'); var vs_b = vsm.find('Bugzilla-B'); var logged_in = false; // Log to a database var connection = mysql.createConnection({ host : '192.168.22.22', user : ‘xxxx', password : ‘yyyyyyyyy', database : 'abtesting' }); var onRequest = function(request, response, next ) { var cookie = new Cookies( request, response ); var bugz_login = cookie.get("Bugzilla_login"); if( !logged_in || !bugz_login ) { // Default action: Send to A vs_a.newRequest(request, response, next); return; } // Add the user to the database automatically if they don't already exist connection.query('INSERT INTO abtest (userid, ip) select * FROM (SELECT ' + bugz_login + ', "' + request.connection.remoteAddress + '") as tmp WHERE NOT EXISTS(SELECT userid from abtest where userid=' + bugz_login + ')', function(err, rows, fields) { if (err) throw err; // Use the database to decide which server to send this request to connection.query('SELECT opt_in from abtest where userid=' + bugz_login, function(err, rows, fields) { if (err) throw err; var opt_in = rows[0].opt_in; if( !opt_in ) { vs_a.newRequest(request, response, next); return; } else { vs_b.newRequest(request, response, next); return; } }); }); }; // onRequest var onExist = function(vs) { if(vs.id == 'Bugzilla') { vs.on('request', onRequest); connection.connect(); logged_in = true; setInterval(keepAlive, 60000); } }; vsm.on('exist', 'Bugzilla', onExist);
  • 14. URI MANAGEMENT (REDIRECTION) Devices Internet • Manage hundreds of redirects/rewrites (www.example.com/app2  www.example.com/app/v2) • Update redirects without incurring potential outages • Turn over management to the business folks because updating http conf files every other day isn’t exactly the job you signed up for @lmacvittie #gluecon serverGroupA serverGroupB vs1 vs2
  • 15. TRAFFIC REPLICATION Devices Internet Production Staging serverGroupA serverGroupB LB LB • Selected requests are replicated to both environments • Selection criteria can be custom logic or network or application variables @lmacvittie #gluecon
  • 16. TRAFFIC REPLICATION Devices Internet Production Staging serverGroupA serverGroupB LB LB • Production response flows back to user immediately • Staging response is blocked from clients • Custom code can compare production and staging response, report errors, slowness, etc. and can log for later analysis @lmacvittie #gluecon
  • 17. function forwardRequest(request, response, next) { "use strict"; var vsm = require('lrs/virtualServerModule'); var http = require('http'); var mgmt = require('lrs/managementRest'); function ReplicateTraffic(scenarioName, primaryVSName, secondaryPort) { var self = this; self.scenarioName = scenarioName; self.primaryVS = primaryVSName; self.port = secondaryPort; //We need a secondary port that we expect is a loopback virtual IP that //goes to the secondary virtual server vsm.on('exist', primaryVSName, function(vs) { vs.on('request', function(req, res, next) { self.replicate(req, res, next); }); }); } ReplicateTraffic.prototype.cloneReq = function(req) { var newReq = http.request({ host: "127.0.0.1", port: this.port, method: req.method, path: req.url, headers: req.headers}, function() {}); return newReq; } ReplicateTraffic.prototype.replicate = function(req, res, next) { if(req.method == 'GET' || req.method == 'HEAD') { // Only do GET and HEAD var newReq = this.cloneReq(req); // I want to do vsB.newRequest(newReq) but cannot // so I loop it through a dummy vip in cloneReq newReq.on('response', function(res) { console.log('saw B resp'); }); newReq.end(); } next(); } var repl = new ReplicateTraffic("xxx", 'vsAandB', 15000);
  • 18. Network stuffs belong in the network. WHEN SHOULD I USE A PROGRAMMABLE PROXY? @lmacvittie #gluecon
  • 19. How to choose between proxy and app NETWORK STUFFS • chooses an application instance based on HTTP header • Content-type, URI, device (user-agent), API version, HTTP CRUD operation, etc… • chooses an application instance based on payload • Value of a key in a JSON payload, XML element value, HTML form data, etc… • would force you to use an HTTP redirect • Changing URLs • Deprecated API calls • is enforcing a quota (rate limiting) to avoid overwhelming applications • needs to do a network thing (e.g. app routing, load balancing, service chaining) that requires application data from an external source (database, API call, etc…) Put the logic in a proxy if the logic …. @lmacvittie #gluecon
  • 20. Use programmable proxies to implement deployment patterns that require more logic than basic conditionals or data from external sources DEVOPS PATTERNS @lmacvittie #gluecon Canary Deployments Blue/Green Deployments A/B Testing v.1 v.2 v.3 API Management Redirection Replication (Dark Architecture)
  • 21. If you can code it, you can do it (probably) PROGRAMMABLE PROXIES More things you can do with a programmable proxy Application security Broker authentication Identity devices and users v1.04 API version matching Rate Limiting / API quota enforcement @lmacvittie #gluecon
  • 22. Programmability in the Network: Traffic Replication Programmability in the Network: Canary Deployments Programmability in the Network: Blue-Green Deployment Pattern Devops.com - Code in Flight Gluecon 2013 - Dark Architecture and How to Forklift Upgrade Your System Dyn's CTO Cory von Wallenstein: LineRate Proxy Download (https://linerate.f5.com/) @lmacvittie #gluecon

Editor's Notes

  1. All of these deployment patterns require dynamically changing the route through the network. They require layer 7 routing.
  2. A programmable proxy is not the same as a web server proxy. A web server proxy separates the proxy from the application. The application can’t modify the config or behavior of the proxy. A programmable proxy brings it all together and code can interact with “config” and network stuffs as well as with application stuffs.
  3. Managing redirects (www.directv.com/NFL -> www.directv.com/entertainment/something) can quickly become a coordination nightmare 5 or 15 are easy, but what about hundreds? How do you respond to marketing campaigns quickly without incurring potential outages? (A typo in http.conf can bring down a web server) How can we get better control of “redirect sprawl”?