First, you hit them over the head with a copy of "SQL Antipatterns: Avoiding the Pitfalls of Database Programming". It is a tad out of date and tends to use PHP and MySQL for the main examples but does also address different solutions available in PostgreSQL, Oracle. MS SQL server, etc. while pointing out the risks of various common foot-guns and providing alternatives.
Or point them to this recent Linux Journal article by Reuven Lerner (who is occasionally seen on these lists):
Developers often have a pre-Gallileo world view that they and whatever app they are coding is the center of the universe and databases, networks, storage and the rest all revolve around them existing only to support their app.
But ultimately the church of the developer gets forced into the modern era and finds that the data is at the center and the apps that allow input, maintenance, extraction and analysis all revolve around those core crown jewels. Then, *gasp*, there are other people and apps touching "your" data. Are they all validating the data the way you do? Protecting it? Retrieving it efficiently? Only then does the real value of the database come into focus.
Cheers,
Steve
On Tue, May 3, 2016 at 9:11 PM, Guyren Howe <guyren@xxxxxxxxx> wrote:
I've long been frustrated with how most web developers I meet have no idea how to use an SQL database properly. I think I'm going to write a book called Love Your Database, aimed at web developers, that explains how to make their apps better by leveraging the power of SQL in general, and Postgres in particular.
I'm thinking of a section on features of SQL most folks don't know about (CTEs are *way* to hell at the top of that list, but also EXCEPT/INTERSECT and window functions), but much of the book would be about how to do things server side. Benchmarks showing how much faster this can be, but mostly techniques — stored procedures/triggers/rules, views.
I asked a colleague about the advice I often hear stated but seldom justified, that one shouldn't put business rules in the database. He offered that server-side code can be hard to debug.
I'm sure many here would love to see such a book published, maybe some talks on the topic given.
What might I cover that I haven't mentioned? What are the usual objections to server-side code and how can they be met? When *are* they justified and what should the criteria be to put code in Postgres? Any other thoughts? Any other websites or books on the topic I might consult?
TIA
--
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general