Last post Apr 22, 2011 04:15 PM by r_nassabeh
Apr 14, 2011 09:57 AM|jastoh|LINK
I have a web application which has a resource hungry module. I am planning to take the module out as a separate application.
Main Application (with database A, on host A) will connect to Module B (with database B, on host B) . With data sent from Application, Module will read Database B and start working. When data has been processed, it will be returned to database A.
Is this even possible? If yes, what is the best way to do this? Set Module B as a web service?
Apr 15, 2011 07:21 PM|r_nassabeh|LINK
You can design module B as a web service and call it asynchronusly from modula A. This way module A will not havt to wait for modula B to complete is's heavy resource consuming processes.
Take a look at the following link for web service asynchronous invocation:
Apr 22, 2011 02:07 AM|jastoh|LINK
Thanks for your reply. Can module B return database rows to module A using this asynchronous web service method?
Edit: Will it also work the same way if in Module A I create a separate thread to call the web service (Module B)?
Apr 22, 2011 04:13 PM|r_nassabeh|LINK
Your'e welcome jastoh
Module B can return anything to mdule A including DataSets, DataTables, generic lists of custom business entities (usually called DTO or Data Transfer Objects) to module A. Technically speaking any Serializable class can be used as the return data type.
Will it also work the same way if in Module A I create a separate thread to call the web service (Module B)
Not exactly. Both models are asynchronous, both speed up UI response and both need some effort to synchronize the results. Bu a thread runs on the same machine as module A and if it is CPU intensive then it will decrease performance which will affect this
module, but if you go the web service way, module B can be deployed on another machine and the overall performance and scalability will be better.
Apr 22, 2011 04:15 PM|r_nassabeh|LINK
Also, found another usefull topic, at Asynchronous Wait State Pattern in ASP.NET that can help you whit this issue.