views:

108

answers:

2

My kind webhost (1and1) royally asked me to go elsewhere to do something like this.

I have 2 sites. One of them was developed by a .Net programmer. Now I am contracted to implement a PHP site and fetch data from the .Net site.

There is an ASP.Net form that a customer fills and when they hit submit, the data gets stored in SQL Server DB. How do I also store the same data in MySQL parallelly? I cannot directly use some database connectors with ASP.Net since MySQL connectivity is not supported on 1and1 Windows hosting (biz account, no less!).

What I thought of is to publish an RSS feed of entries in ASP.Net site and routinely scrape that data into MySQL on Linux host. It is an overkill, I know. Not efficient.

I thought I would pick the best brains on SOF to get a different, efficient opinion. Thanks in advance guys...

+1  A: 

I wouldn't use RSS feeds and polling for the following reasons:

  1. RSS feeds normally only list the last 10 or so items that are new. Choose an incorrect polling time and you could miss updates or use too much bandwidth.
  2. Polling is inefficient as you're only really concerned about when something has changed. Ideally, you want the minimum amount of traffic between the two sites.

I would use a REST style service to POST updates in JSON to the PHP site. When an update occurs in the ASP.NET site, it should push an update to the PHP site. You may also want to make this process occur asynchronously so that it doesn't impact the users of the ASP.NET site.

EDIT: For the PHP side, it looks like you could use JSON-PHP, Zend Framework or, if SOAP has better support, you could use the SOAP PEAR library. For the .NET side, you could then use something like Json.NET to serialize your .NET objects and then just make WebClient calls.

Richard Nienaber
Thanks Richard. Could you please elaborate or point me to links which will help me achieve this? My setup includes a ASP.Net(C#) based site which should insert data into MySQL though my .Net host doesn't support MySQL :(
ThinkCode
Edited to add links
Richard Nienaber
A: 

thx for information...

freddo