Re: Thoughts on "Love Your Database" - Mailing list pgsql-general

From Will McCormick
Subject Re: Thoughts on "Love Your Database"
Date
Msg-id CA+jgkY7WYq0PJUqGTk8eoivvEfATaXS5ZvJbDVs6Hw=3sEEsKw@mail.gmail.com
Whole thread Raw
In response to Thoughts on "Love Your Database"  (Guyren Howe <guyren@gmail.com>)
List pgsql-general
A reason to consider may be portability. What happens if I want to let my customer chose their data store or I just don't want to put all my eggs in one basket.Technically there are truths but you cannot ignore the business side either. If a we can exceed our performance requirements and keep things generic/portable this is the best of both worlds.I think this is the main reason people separate the business logic from the database. How many of you have ported databases between platforms? Or had multiple types of data stores in the same company?

On Wed, May 4, 2016 at 12:11 AM, Guyren Howe <guyren@gmail.com> 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@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

pgsql-general by date:

Previous
From: Steve Crawford
Date:
Subject: Re: Thoughts on "Love Your Database"
Next
From: Jeff Janes
Date:
Subject: Re: Insert only table and size of GIN index JSONB field.