Common data: using data in your application

Data: the issue

The data issue is a generic issue for financial applications. Regardless of how much data can be shared and pre-loaded in the service instances, you still need to pass some task-specific data between the Symphony client and service through the Symphony task message.

In many financial applications, a market dataset is often shared by more than one task. If you send this market dataset through task-specific input messages, the same data is sent more than once across the network. To reduce network traffic, maximize the shared data and minimize the task-specific data.

Common data

If you have input that is common to all tasks within a session, such as data that is required by every service invocation for a given session, you can create a Message object to encapsulate this common data. In this context, the Message object is referred to as common data.

Common data represents state that can be made available to service instances for the duration of a session.

When to use common data

Use common data when you need to set up the session-specific state of a service, and you only want to do it once per session, not on every task. Common data is useful for passing data from a client to a service. The service loads the data when the session is created.

You can use common data, for example, to set the environment in the service that is common to all tasks in a session. This way you only need to set the environment once, when the session is created.

Session-to-service instance affinity

Symphony attempts to use the same service instance for all tasks in a session as much as possible.

A service instance is made available to other sessions only when session workload completes, a session is closed or aborted, or when another more deserving session is assigned the service instance.

Lifetime of common data

You can access the common data in the service during execution of onSessionEnter( ) on the ServiceContainer.

The common data object sent from the client can be deleted after the Connection.CreateSession( ) call returns.

Common data update

Common data update allows a client application to send updates to existing common data after a session is created. You can send the updates from the client to your service by calling the update() method on the session object. You can access the updated common data in the service, during execution of onSessionUpdate( ) on the ServiceContainer.