Welcome!

XML Authors: Jason Bloomberg, Asim Saddal, Greg Schulz, Richard Schwendiman

Blog Feed Post

LineRate: Some of UR Code Are Belong to the Network

#devops #NodeSummit #nodejs #F5 is putting the power of node.js in the network

API versioning. API metering. URI rewriting. Cookie management. A/B testing. Canary deployments. API façades.

Traditionally these tasks have been implemented through a variety of hacks and manual configuration in web server or proxy conf files. URI rewriting? Write some regular expressions in Apache and restart the process. Decisions on routing - do I send Bob to the beta version or the release version? - or authentication requiring database access?  Hard-code it in the application and use performance-killing redirects and consume valuable application resources. Want to use memcached to improve performance and scale? Hard-code it in the application. 

Domain logic doesn't belong in the application, or in the data access API. It belongs in an app proxy along with load balancing, SSL termination and performance-related functions typically associated with "the network" and typically associated with complex, network appliances. That all changes today.  

If you've been following along (and you probably haven't but that's okay) F5 has always been a pioneer in the realm of programmability in the network. We've always been convinced that it is far better to put the power of programmability in the hands of the folks who know their applications and architectures best than it is to try to bake into products features and functionality that are generalized and only address a specific set of challenges. Programmability, as promised by SDN and other emerging technologies, ensures the ability to innovate and mitigate on your own schedule, not ours.

There are a variety of choices out there today for an app proxy, but none of them puts the power of programmability - real programmability - into the hands of devops practitioners and developers alike.

LineRate App Proxy does just that.

Seriously. Rather than slogging through a configuration file and coming up with this (which has to be deployed on every applicable instance): 

RewriteCond %{HTTP_HOST}   !^www\.example\.com [NC]
RewriteCond %{HTTP_HOST}   !^$
RewriteRule ^/(.*)         http://www.example.com/$1 [L,R]

you can just write familiar code once, like this*:

"use strict";

var vsm = require('lrs/virtualServerModule');
var url = require('url');

var DoSomething = function(servReq, servResp, next) {
  if('host' in servReq.headers && servReq.headers.host) {
    var hostHeaderParsed = url.parse('http://'+ servReq.headers.host);
    if(!(hostHeaderParsed.hostname.match(/^www\.example\.com$/i))) {
      // Host name exists but is not www.example.com
      servReq.removeHeader('host');
      if('port' in hostHeaderParsed)  {
        servReq.addHeader('host', 'www.example.com:'+ hostHeaderParsed.port);
      } else {
        servReq.addHeader('host', 'www.example.com');
      }
    }
  }
  next();
};

var RegisterforRequest = function(vs) {
  vs.on('request', DoSomething);
};

vsm.on('exist', 'vserver', RegisterforRequest);

The new reality of applications is they are often API-driven and their core architecture is changing. That means "the network" has to change, too, to accommodate new applications, new architectures, and new ways of designing and deploying the next generation of web applications.

The Change Your Network has been Waiting For

F5-bw LineRate App Proxy is that change for the network, bringing programmability through node.js to the network with a simplified, software-defined approach that better fits with modern application architectures. It's software but, as the name implies, it's fast software - providing line rate speeds and capabilities that not only let you implement the architectures you need, but scale that entire architecture to unprecedented levels. 

Because it's programmatic, there's really no limit on what you can do. Need to talk to a database? You can do it. Need to implement an API facade or convert XML to JSON (or vice versa)? You can do it. Need to support multiple applications on a single physical host? You can do it. Need to replicate real user interactions so you can test a new version or application? You can do it.

The core premise of LineRate is simple: Develop your application. Control your network.

LineRate represents a transformational shift in not just the network, but operations. Why mess with configuration files and OS-level scripts when you can programmatically deploy, manage and control your app proxy via a REST API? Why settle for OS-level module management and recompiles to install new functionality when you can dynamically use existing repositories like npm?

Your application architectures and operational environments are transforming thanks to emerging technologies like REST-based APIs, mobile, cloud, HTML5 and more. The network - including proxies - can't get in the way by remaining complex, static and difficult to manage. It needs to be fast, agile, and programmable.

That's what LineRate brings to the table.

But you don't have to take my word for it. If you're a US-based user (sorry, folks, export restrictions and legal stuffs are holding up distribution elsewhere, but rest assured it's coming) you can grab a free version of LineRate today.  

Grab it. Launch it. Grab some caffeine and start coding. You can check out some samples on the LineRate site to get started or head straight to the scripting guide and build your own ... whatever you want.

That's kind of the point. You know what you want and what you need. Now you've got the right platform to build it.

Go forth and conquer the network - with code.  

 

*LineRate extends the Node.js HTTP module with 'addHeader' and 'removeHeader' calls in order to be able to manipulate them as the base Node.js implementation is read-only for headers.


icon-twitter-ns @LineRateSystems

Read the original blog entry...

More Stories By Lori MacVittie

Lori MacVittie is responsible for education and evangelism of application services available across F5’s entire product suite. Her role includes authorship of technical materials and participation in a number of community-based forums and industry standards organizations, among other efforts. MacVittie has extensive programming experience as an application architect, as well as network and systems development and administration expertise. Prior to joining F5, MacVittie was an award-winning Senior Technology Editor at Network Computing Magazine, where she conducted product research and evaluation focused on integration with application and network architectures, and authored articles on a variety of topics aimed at IT professionals. Her most recent area of focus included SOA-related products and architectures. She holds a B.S. in Information and Computing Science from the University of Wisconsin at Green Bay, and an M.S. in Computer Science from Nova Southeastern University.