Distributed applications with databases communicating with each other, is this possible? RRS feed

  • Question

  • User-334216252 posted

    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?


    Thursday, April 14, 2011 9:57 AM


All replies

  • User1699702733 posted

    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:


    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, April 15, 2011 7:21 PM
  • User-334216252 posted

    Hi r_nassabeh,

    Thanks for your reply. Can module B return database rows to module A using this asynchronous web service method?

    Thank you.

    Edit: Will it also work the same way if in Module A I create a separate thread to call the web service (Module B)?

    Friday, April 22, 2011 2:07 AM
  • User1699702733 posted

    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.

    Friday, April 22, 2011 4:13 PM
  • User1699702733 posted

    Also, found another usefull topic, at Asynchronous Wait State Pattern in ASP.NET that can help you whit this issue.

    Friday, April 22, 2011 4:15 PM