2 ms·
This is silly. If you have many applications accessing the database - and not every app will go via your API, unless you plan to rewrite everything - then you w
by gaius 14y ago
This is silly. If you have many applications accessing the database - and not every app will go via your API, unless you plan to rewrite everything - then you want your business rules enforced in one place, that will be effective for any client, be it a command line, a web app, client-server, Excel, third party products, anything.
The web world has produced people for whom there is a 1:1 correlation between app and DB. In the enterprise world, most apps are written to run against existing DBs, some of which have been around for decades. This is scalable development processes. And the funny thing is, web kids will blithely repeat "DRY" without ever understanding the truth of it.
- JoelJacobson 14y agoWhat's wrong with a 1:1 correlation, when it makes sense? If what you need to do is to access or modify data, then a stored procedure language such as PL/pgSQL is perfect for the job. But if you need to render some graphics using GD in PHP, that's obviously not a job for the database. The total API of a system is probably not only stored procedures, but quite a lot of API methods, stored procedures can take care of the entire task, without the need to involve PHP or any other middle-layer language.
- gaius 14y agoBecause it's a tiny corner of the database world, and isn't terribly representative of the majority of database work. The kids who do all their logic in the app, are storing up trouble for themselves in future, when they want to use the DB for more than just the website.