Untitled Document
To read part one of this feature click
here.
Lightening the Load On Service Providers
A SOA composite in which a service consumer makes a number of service calls
to service providers, is shown in Figure 2:

Figure 2: Before | Consuming services without caching
We can use a data grid to front end the service calls and cache results coming
back from service calls or composites. This kind of approach typically works
well with cases in which a particular service has read only or read mostly data,
e.g. reference data, or where multiple invocations to a service over a short
time period are likely to return the same result. This pattern of use is captured
by the Cache aside pattern that is implemented in an ESB or BPEL engine. The
first time a service is called, the result is served to the consumer, but also
cached. On subsequent calls, the application logic looks in the data grid first
and retrieves the data directly from there, should it be available. Relating
this back to the telco-billing example, the bill would be retrieved directly
into the cache when the user logs in. The business logic that executes the bill
retrieval looks in the cache first when it wants to retrieve a bill. This resulting
interaction is shown graphically in Figure 3:
Figure 3: After | Caching service results with fault tolerance
Data of a read only or read mostly nature, e.g. reference data, bills, tariffs,
can be cached easily using this approach. However, data grids provide cache
expiry rules. In our telco example, wireless bills only change once a month
-- so it's definitely ok to cache them for the duration of a session on a single
day. However, depending on the use case, the expiry for data can range from
one second, as in some of the trading applications we have seen on Wall Street,
to a month, as in the telco example. The question that needs to be asked is
how long can you live with stale data?
The benefit of using a data grid is the built-in fault tolerance through the
duplication of data within the grid infrastructure. Traffic is routed to the
backup node (B in the diagram) in case of failure of the primary node (P in
the diagram).
1