direct access database vs web service [closed]

Direct database access couples you tightly to the schema. Any changes on either end affects the other. But it’s got the virtues of being simple and requiring one less network hop.

A web service means better abstraction and looser coupling via one additional level of indirection. A web service can act as the single steward of the data. You’ll get away with going directly against the database when it’s just your app, but if other apps come along and require the same data you’ll increase the chances that they’ll need schema changes some day. Those changes will affect your app as well. The cost is more latency.

A web service can be a good place to centralize authorization and security. A database can do this as well, so perhaps it’s a wash.

Leave a Comment