Question

I have a question about service states in SOA (which are supposed to be stateless):

I have a service that generates a result after a client's request. This result is very big, so the client lazy loads it in order to provide a fast visualization. The resulting data must be cached somewhere for being available for the lazy-loading process.

so, could this result be considered as an 'state' of the lazy-loading supporting service?

if SOA services must be stateless, which SOA pattern should I use to implement this scenario?

Thank you very much!

Was it helpful?

Solution

Assuming that the scenario consists in a process that reads data from a database and allows the users to navigate (forward and backward) through these data, the solution is to implement a paged query mechanism in the persistence layer.

Paged query can be implemented in different ways, the most scalable is repeatable querying the database as the user pages through the result.

A drawback of this solution is that the user can see an inconsistent view of the data due to the database can to change between queries executions.

You can implement this using JDBC directly (if you are using Java) but several ORM framework such as Hibernate helps a lot to implement this mechanism.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top