I’ve seen many enterprise service bus (ESB) implementations that are, well, quite extraordinary. Sadly, they are extraordinary for more wrong reasons than right. Given that we had a SOA frenzy not too long ago, many developers got caught in that feeding frenzy. Hey, when you’re a shark off the south coast of Kwazulu-Natal in winter, everything looks like a sardine. In fact, if you were a tiny sole, just wandering around at the bottom of a big sea, chances are you also wanted some of them some sardines.
That was a long time ago, but now that we get to see the extraordinary things that developers built with their ESB. Here are my top five extraordinary things.
#5 Look, we can synchronize our databases with our ESB
You have two application databases and you want the changes in one to be propagated to the other. The ESB seemed like a perfect way to spray data around. Hey, just give me an end point and I’d pump some data through it. Well, syncing data is a replication problem with different challenges such as change detection, conflict resolution, retry or abort strategies, and bulk materialization on both ends when things get horribly out of sync.
#4 You can call my stored proc from the other side of my ESB
Somewhere in your app you had something that called a stored procedure. The ESB seemed like a really easy way to wrap that SProc with a service and hand out a new end point. Cool, now everyone can call your stored proc. Well, perhaps that original thing that was calling your stored proc was a wrong architecture decision in the first place. If it was the write decision, suddenly opening it up to multiple callers that you have no control over means you got to be certain about whether your SProc is re-entrant, can handle the concurrency, and a whole lot more.
#3 My ESB now manages my transactions
#2 My authentication runs as a centralized service on my ESB
Login seems like an easy enough “hello world” service to get up and running. Hey, since our ESB has all of these apps hanging off it, we can get our Login Service to do single sign on (SSO). We just need to call all the login services for each app and front it with our single sign on service and then this service will dish out authentication tokens. Oh, we might as well put in a centralised authorisation service too. Well, firstly, login is not a service. You can take that thought further from here.
#1 I replaced my call stack with my ESB
To be fair, most developers don’t know that they did this. Let me explain. You had some app that called a method that calls a few more methods and so on. We all know that this builds up a call stack that gets popped on the return path. When you take those classes that have those methods and dump them as services on your ESB, the call stack has not changed, but now there is an ESB in between. Well, you can’t just shift classes wrapped as services to your ESB. You actually have to get service oriented in your architecture. Only then will that call stack change.
It’s not surprising that we see this now. It takes a long time for an architectural style to be understood. Unfortunately, there are some costly mistakes along the way. We also can’t blame the ESB, but, beware, the sardine run happens every year.