Search code examples
c#.netarchitecture

Transfer data between web sites


I need some architectural advice on how to build a background service application.

Background:

I have two web sites, and I need to transfer some data from website A to website B. Service would have to run in a background (as windows service) and should connect (every 5 minutes) to web sites's A database directly (MSSQL) grab some data and insert this data through websites's B API (API is build on MVC Web Api). Both web sites are hosted on a same virtual machine (Windows Server 2008 R2 Datacenter), but this might change (web site B can be switched to another virtual server or cloud hosting as Windows Azure or Amazon AWS).

Question:

What do you suggest (best practices) and what guidelines you can give me? I want this to be scalable and fast as possible and that service will receive multiple requests.


Solution

  • If it is important to know what data was transferred, then:

    1. Add logs - log4net for instance
    2. Issue tickets if the process stops, and close the ticket when it restarts, this way you will know if a process fails. Depending on the amount of data use you could use Redis/Riak.
    3. Put monitoring on each service A and B, and you might also consider restarting the service via IIS on fail down.