So we're building a locally(at customers site) hosted, custom point of sale system, nothing too much out of the ordinary. Its all .NET, C# and SQL Server.
One of the requirements is that the system allows orders to be taken over the internet as well. For various reasons(connection reliability/speed, backups, stability, maintainance, etc) the web portal will be hosted off-site, with some standard web hosting company.
The product details are in the local DB, and thus we need to somehow sync the external website DB with this data. It has to be secure obviously, and not too bandwidth heavy.
We came up with a solution that minimises exposure of the local DB to the outside world:
- the web app cannot access anything from the local app.
- the only way data can be moved is by a push sent from the local app to the web app.
- the only thing the web app can do is send a notification to the the local db that a new order has been taken. The local app will then connect to the external app and pull the order details.
So we were thinking of a design like this, using web services, and just defining basic actions on the web app like addProduct(id, blah blah blah)
But then we have to write routines to keep stuff in sync, like if a product is deleted from the local app, but the external app is temporarily unavailible, etc, etc...
Is this a resonable approach, or is there a better way?