News

Event-driven publish-subscribe technology changes developer's thinking

The event-driven, publish-subscribe model offers a new way of conceptualizing development, says Doug Moore, president of Accius Systems, a software consultant specializing in data-driven Internet applications.

Moore has been building applications for commodity exchange brokers using event-driven integration software from KnowNow, which uses JavaScript and HTTP to link pricing data to traders holding a wireless tablet on the floor of the NYMEX exchange.

'You get to a new way of thinking about applications,' Moore says of these projects. 'Dealing with events rather than saying, 'I'm going to build a query, go to the database, get the data and refresh the page.' It's a different approach.'

The development for the wireless commodity trading applications was built with JavaScript and HTML, he explains. Even providing the kind of audit trail brokerages require was easier with the KnowNow event router technology, he says.

'They needed the persistence data for up to a month or two, and the KnowNow system has built-in persistence,' Moore says. 'It does event routing, but it also persists the event for as long as you tell it to because it has a built-in database to do that.'

Not having to link to a third-party database was a major time saver in the project. 'Instead of leveraging SQL Server, Oracle or some other database system to persist the trades,' he says, 'we just leveraged event router and set the expiration time on the events to about a month. That sped up development tremendously. We didn't have to develop a schema, an engine, the code to request it and the response and all that.'

The publish-and-subscribe approach appears well suited to commodities trading applications where the key requirement is to get the latest numbers for bids and offers onto the trader's tablet PC via a Web browser. KnowNow's push technology uses a JavaScript connector that provides the developer with an API for setting up subscriptions to exchange systems so that when an event occurs, such as a bid going up or down, it is pushed to the broker's tablet, Moore explains.

'We were able to quickly create some routines that subscribed to topics that received these events, bids and offers,' he says. 'It would have the type, whether it was an offer, the company that had it and the price. It has built-in fields like timestamp, so you're able to subscribe and get these events into JavaScript objects, and then use JavaScript and HTML to put that on the [browser] page.'

The subscribe-and-publish approach also takes pressure off servers and provides faster updates without having to rebuild the entire Web page.

'One advantage to this push technology is there's no page refresh,' Moore says. 'So there's no reload of the page and graphics. You get anywhere between half-a-second and an eighth-of-a-second response time. Only the changes get pushed to the browser. The data is just pushed into the display. There's no user interaction, no polling by the browser client. It really reduces the load on the servers.'

Moore recalls that before he found the KnowNow technology, he built a trading system that relied on polling to update prices.

'With that system, we had to poll for all the prices in the market every five seconds to see if any changes had been made,' he says. 'As you can imagine, that creates quite a bit of load on the server as it scales up.'

KnowNow is announcing the latest version of its product, KnowNow 3 Enterprise Edition, this week. Further information is available at http://www.knownow.com.

More information on Accius is available at http://www.accius.com.

About the Author

Rich Seeley is Web Editor for Campus Technology.