views:

30

answers:

1

Is there any tech out there that allows for a hosted web application to connect to a local database? For example, say I would like to write some web-based software for a popular point-of-sale solution. The ideal would be to have the customer input their database connection credentials and have the application connect to their locally hosted database.

Why would I want to do this?

  • Low barrier to entry to use software: no data exports / imports
  • No need for customer to install a publicly exposed web service
  • For web apps with private data sets (think ERP, POS, CRM), the private data could all be hosted locally

Is this a pipe dream?

+1  A: 

Unless you have control over your customers network, this isn't really practical because SQL server needs a TCP port to communicate over, and that port needs to be open on your customers network - AND publicly accessible over the open internet (possibly a big security concern). This is why people usually use web services - if you hack a webservice, well, you can use the webservice... If you hack a database you can do anything you want to it including purging/corrupting the data in any way you like.

The default SQL server TCP is port 1433, but you can change this port if you want to.

Otherwise, if you arent concerned with opening a port on your customers network and having that port open to the database from the public internet, you can actually do what you are describing... I've actually done it myself for a merge replication project in the past over the open internet. So no, this isn't a pipe dream - it is just mostly impractical in most scenarios due to security concerns.

Security concerns can be mitigated through a good secure encrypted connection to the server, however. See http://msdn.microsoft.com/en-us/library/ms191192.aspx for more details, if you want to go that route.

vdoogs
That is an interesting option (opening the TCP). However, I'm not wanting to open it up publicly over the internet. I see this connection happening on the client-side, completely behind the firewall. Even if a hacker were to hack their user account on the web application, they would have 0 access to the database unless they were on the local network or VPN.
retailevolved
No: they could see the connection information in the web app and get to your database about just as easily as if your database were on the same server as your app.
Jason Swett
How? With what I am wanting, the web app would store the local database credentials. I would not open it up to the world. Let's say I'm a hacker and I log in and see that the DB address is 192.168.2.25 - there is no way for me to connect to that database unless I am on the same network. Hence, the need for the database connection to be happening on the client side.
retailevolved
If the server is not connected on the public internet, you are correct, And Jason Swetts comment is incorrect. If I understand correct you would have achieved you goals via my explained method. Please accept my answer, I believe I have answered your question satisfactorily.
vdoogs
@vdoogs - I'm marking the answer accepted but it does not truly answer my goal which is to have a user input local (as in 192.168.x.x) credentials and connect to that database probably through browser extension and JavaScript. Your answer is good and my question was probably not clear enough.
retailevolved