BIG-IP: The business rules engine (BRE)

You can stop laughing now, I'm serious!

If you've worked with BPM (Business Process Management) products you may recall that most of them support the inclusion of external business rules via Web services or proprietary APIs. While BIG-IP isn't going to win any BRE contests, it can be used to externalize some business rule functionality through iRules.

Now I'm not going to tell you that BIG-IP and iRules can replace a product like Corticon or CA's CleverPath Aion or Oracle's business rules engine. I'm certainly not going to suggest that you implement a loan-approval or mortgage amortization rule using iRules. I am going to tell you that using iRules you can do some pretty interesting offloading of business-logic in a fashion similar to that of enterprise business rules engines.

Tis the Season to Discount

As it's nearing the holidays, e-tailers (how's that for bringing back some old terminology?) often offer discounts on shipping or just have a huge sale the closer it gets to Christmas. This often requires that the code that calculates pricing be updated each time the date changes and the discount gets larger.

Large enterprises might externalize that discount into a web service, thereby eliminating the need for the code to change with every seasonal discount offered. The developer simply calls a service that calculates the current discount and doesn't have to worry about whether it's two-weeks or two-days until Christmas - the external service calculates that based on business rules.

Now, if you don't have an external BRE (Business Rules Engine) then you might develop your own service. But it's likely that this service will require recoding as well, or at least some sort of table on which to base its calculations. And of course if you change the code, you have to retest and redeploy and that can be a tedious thing - especially when those tasks interrupt your own holiday shopping or post-lunch naps.

Instead of coding up an external service, put some logic into your application to look for a query parameter called discount and use it to calculate the total for an order. Now all you need to do is write an iRule that checks the date and determines what the discount should be, then pass that value to the application (either using a cookie, query parameter, or as a name-value pair inside the POST data). Or, you can do the calculation on the response data and insert the discount right into the page presented to the customer before they approve the order. If you're really into efficiency the iRule can actually rewrite the total amount of the order based on the discount for you before it even reaches the customer.

Sure, you still have to do some data entry, but you can use the same iRule for every application that might need that discount value, which means less duplicated code and fewer chances to introduce errors into the calculation of that value. If this sounds a lot like SOA then you're hearing things correctly. Shared services increase operational efficiency, mitigate risk, and enable business and IT agility. BIG-IP achieves these goals in much the same way as a well-designed SOA - through the reuse of loosely-coupled, shared services. 

This is, of course, just an example. There are plenty of other business rules that could easily be externalized into an iRule as a shared service, which effectively turns your BIG-IP into a business rules engine. How about these possibilities:

  1. Based on the value of a loan request, automatically route the request to your workflow application instead of the automated approval application.
  2. Use a global counter that increments every time a response from the order-processing server returns with a valid order and offer the customer placing the 1,000,000th order a special gift! 

By harnessing the power of a full-proxy like BIG-IP combined with iRules you can do a lot of things you probably never thought you'd be able to do in a "network device". That's because most network devices aren't application-fluent like BIG-IP and aren't equipped with anything as flexible as iRules

Imbibing: Mountain Dew