Hierarchical Topics

Hierarchical topics are a powerful tool in helping ensure that you only publish the finest grain of information that you absolutely need to. Not only does this help you keep bandwidth use to a minimum, but also, given its tidy and logical nature, your application’s code will be easy to understand and consequently reduce support and maintenance.

Example: Betting Exchange

A betting exchange, traditionally, shows the market depth three deep for both the available buy and sell orders. To avoid complexity the exchange may also offer a more simplistic view, or ‘express’ view, to those who only want to view the price as they might on a traditional betting site (i.e. the best buy). Diffusion offers a neat solution to ensure users only receive and process data they are actually interested in. A user viewing the full market depth will subscribe to the topic for the market. They will receive all the updates for all six child topics. Whilst a user viewing the exchange in the ‘express’ view will only subscribe to the child topic 1ST_BUY and their browser will only need to process updates for that topic rather any price update for that market.

Hierarchal Topics, Betting Exchnage Example

Example: FX outright and spot pricing window:

In the example below we can see how you might arrange the topics for FX, GBP/USD, prices.

Hierarchal Topics, FX Spot/Outright Example

In the example, you can see that the user only subscribes to the topics they are interested in thereby preventing the user from having to consume/handle price updates for tenors they are not interested in. By splitting each tenor into ‘bid’ and ‘offer’ topics we ensure only the bare minimum, of information, is sent out. For example should only the ‘bid’ price change for a given tenor, then only this data, the new bid, is published.

At the same time, any, user interested in all the rates associated to GBP/USD can simply subscribe to the parent topic.