Design question: large XML data in Web Service
I have a web service design question here and hope to get your inputs.
I need to design two services, say, WS1 and WS2. WS1 needs to talk to a database to get some data and WS2 is the consumer of WS1 and itself is a service as well. Now, for WS1, I need to make DB call to get a few hundred rows of data (4 or 5 fields). I want to make this data into XML format before WS2 consumes it. My question is: what is the best way to design this, especially, get this large amount XML data (the xml tags and real data) transmitted without affect performance? First of all, I don't want to make a DB call each time when WS2 consumes WS1. Certainly, I am thinking some sort of cache mechanism for WS1 to make its DB call first (or even when WS1 is consumed at its very first time) and cache the data somewhere then when WS2 consumes WS1, WS1 goes to the cache to obtain this large amount of data. However, the issue here is what if the DB source changes (i.e. updates and modifications, etc.)? How do I refresh my cache? Any other suggestions? What is the typical way for a web service (or web services) to handle large amount XML data?