HL7":3kqapezi said:
For those of you saying to use a web service, do you believe this is the best approach even for applications that are entirely on an internal corporate network? I maintain an application that I wrote for a client and I originally used the web service model. In updating it for the latest version of .NET, I planned to remove the web service and do data access from the front-end web application using sprocs. The users don't actually have a login for the SQL database -- they have an application-specific login, but only the domain 'aspnet' user has database access, and the program is a web application -- nothing runs local. This seemed to me to be the same level of security as using a web service -- right?
A web service is still preferable, IMHO.
[*] WS apps are easier on the IT guys than allowing multiple clients to connect to the DB directly. If well-controlled internal servers and select developer workstations are the only clients that can reach the DB through the firewall, then IT can take a more... pragmatic approach to DB patches. On the other hand, if random employee laptops access the DB directly, IT is under much more pressure to apply security patches immediately. Also, if "something" is DOSing the database, there's fewer "something" for them to track down.
[*] Web services
tend to work better over VPNs. This is not a hard and fast rule, obviously. However, the act of making your web service tends to make you think about the data-transfer chattiness. Going 100% SPROC (and no VIEWs) could get you the same thing, but you still can end up with situations where a client is holding onto a result cursor for too long.
[*] Keeping DB drivers up-to-date on client machines sucks.
[*] Flexibility. I've always found it easier to move machines around when clients are connecting to a genericly-named web front end. Easy to point the webserver at a different DB. Easy to point the DNS entry at a different web server.
[*] Connection limits. If for performance or licensing reasons your DB has a limited number of incoming connections, it's easier to control that with a WS architecture than with clients connecting directly.
[*] Aggregating disconnected data. Having client apps access multiple data sources simultaneously makes the data flow very complex. Imagine you have 10 data sources and 100 clients. Now mentally draw a network diagram for those clients to connect to each of those data sources. Much simpler to have your clients connect to your WS and your server connect to the other data sources.
Apps with a lot of ad-hoc queries are really the only ones I would consider giving direct DB access to these days.