Universal Messaging 10.3 | Concepts | Messaging Paradigms | Publish / Subscribe (using Data Groups and Data Streams) | Sample Structures for Data Groups and Data Streams
 
Sample Structures for Data Groups and Data Streams
Example 1: A sample data group structure
Imagine a Foreign Exchange organization that provides different tiers of currency price data to users on different desks at their various customers. Valued customer desks might be provided with gold level data, while less valued desks might receive silver or bronze tiered data:
*EURUSD_Gold
*Customer_Desk_A
*User1
*User2
*Customer_Desk_B
*User3
*User4
*EURUSD_Silver
*Customer_Desk_C
*User5
*Customer_Desk_D
*User6
*EURUSD_Bronze
*GBPUSD_Gold
*Customer_Desk_A
*User1
*User2
A suitable data group structure to represent this arrangement might be to create eight data groups:
*EURUSD_Gold
*EURUSD_Silver
*EURUSD_Bronze
*GBPUSD_Gold
*Customer_Desk_A
*Customer_Desk_B
*Customer_Desk_C
*Customer_Desk_D
Then, structure these data groups as follows:
*EURUSD_Gold
*Customer_Desk_A
*Customer_Desk_B
*EURUSD_Silver
*Customer_Desk_C
*Customer_Desk_D
*EURUSD_Bronze
*GBPUSD_Gold
*Customer_Desk_A
Price data would be published directly to the four data groups EURUSD_Gold, EURUSD_Silver, EURUSD_Bronze and GBPUSD_Gold (though, optimally, a publisher may well choose not to publish to the empty data group EURUSD_Bronze). By virtue of this structure, prices published to EURUSD_Gold, for example, will be delivered to both the data groups Customer_Desk_A and Customer_Desk_B.
End user clients with data stream-enabled sessions can be added to arbitrary data groups - and thus receive data from those data groups. So, for example, adding User1 and User2 as data stream members of the data group Customer_Desk_A, both users would, by virtue of the above structure, receive price data via their inherited membership of both EURUSD_Gold and GBPUSD_Gold.
Example 2: Dynamic Changes in the sample data group structure
Let us now assume that our organization decides to upgrade the level of EURUSD price data sent to users on Customer_Desk_C from silver to gold.
Achieving this with data groups is extremely simple. All we need to do is remove the Customer_Desk_C data group from the EURUSD_Silver data group, and add it to the EURUSD_Gold data group instead, resulting in the following new structure:
*EURUSD_Gold
*Customer_Desk_A
*Customer_Desk_B
*Customer_Desk_C
*EURUSD_Silver
*Customer_Desk_D
*EURUSD_Bronze
*GBPUSD_Gold
*Customer_Desk_A
Example 3: Even More Dynamic Changes in the sample data group structure
Let's take our example a little further. Assume that the publisher of the gold EURUSD price data stops for some reason, and that the organization decides customers who were receiving this data should, for the time being, fall back to silver EURUSD level prices instead.
One way of doing this would be to move the three data groups Customer_Desk_A, Customer_Desk_B and Customer_Desk_C out of the EURUSD_Gold data group and into the EURUSD_Silver data group.
An even simpler way, however, would be to just move the EURUSD_Gold data group itself into the EURUSD_Silver data group, resulting in the following structure:
*EURUSD_Silver
*EURUSD_Gold
*Customer_Desk_A
*Customer_Desk_B
*Customer_Desk_C
*Customer_Desk_D
*EURUSD_Bronze
*GBPUSD_Gold
*Customer_Desk_A
This structure could be used while the gold level publisher of EURUSD prices remains inactive. Once the publisher of the gold level data restarts, the EURUSD_Gold data group can be removed from the EURUSD_Silver data group (since if it were not removed, the users expecting gold level EURUSD prices would now receive both gold and silver level prices).