Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1f5Ivt-0000qc-G7 for pgsql-general@arkaria.postgresql.org; Sun, 08 Apr 2018 22:37:09 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1f5Ivs-0002sY-3X for pgsql-general@arkaria.postgresql.org; Sun, 08 Apr 2018 22:37:08 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1f5Ivr-0002sO-Q1 for pgsql-general@lists.postgresql.org; Sun, 08 Apr 2018 22:37:07 +0000 Received: from rs111.luxsci.com ([74.205.104.180]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1f5Ivo-00008w-PT for pgsql-general@postgresql.org; Sun, 08 Apr 2018 22:37:07 +0000 Received: from rs111.luxsci.com (localhost.localdomain [127.0.0.1]) by rs111.luxsci.com (8.14.7/8.14.9) with ESMTP id w38Mb0PA004964 for ; Sun, 8 Apr 2018 17:37:00 -0500 Received: (from lshttpd@localhost) by rs111.luxsci.com (8.14.7/8.14.9/Submit) id w38Mb050004963; Sun, 8 Apr 2018 22:37:00 GMT Message-Id: <201804082237.w38Mb050004963@rs111.luxsci.com> From: "g@luxsci.net" Date: Sun, 08 Apr 2018 22:37:00 +0000 To: pgsql-general@postgresql.org Reply-To: g@luxsci.net Errors-To: g@luxsci.net MIME-Version: 1.0 X-Comment: Charset encoding changed from (utf-8) to (UTF-8) for compatibility with message contents. X-Comment: 85389-8711-1 Subject: Re: Rationale for aversion to the central database? Content-Type: multipart/mixed; boundary="------------------_Boundary_85677071.7481402"; charset="utf-8" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=luxsci.net; h=message-id:from:date:to:reply-to:mime-version:subject:content-type; s=p1; bh=h4n0IGCcVvIPNCkvfD1HAQ6zfCbl90Q95Hwg0k+u12M=; b=K0x1UDCfJe5sCvV9aM2NHT2i31G418vA9WfsxZadx/PHVn/ddybJtBZfDbnzb1Oiuw2tgPiAb3ElsuXAQR4jBP41fTRhD6qjZ1kQAk646VajUDifjS18Me9z5WU536uS0deu9wuw5S06oE8046en0u3HHIQ/NAwA9qkpvmKV0iQ= List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk This is a multi-part message in MIME format. If you cannot view the attachment(s), then your email client does not support MIME. --------------------_Boundary_85677071.7481402 Content-Type: multipart/alternative; boundary="-------------7657391.42080772" ---------------7657391.42080772 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable =C2=A0 =C2=A0 On April 8, 2018 02:40:46 pm PDT, "Guyren Howe" wrote: =C2=A0 I am a Rails developer at a medium-large size company. I=E2=80=99ve mostly= =20 worked at smaller companies. I=E2=80=99ve some exposure to other web=20 development communities. When it comes to databases, I have universally encountered the attitude=20 that one should treat the database as a dumb data bucket. There is a=20 *very* strong aversion to putting much of any business logic in the=20 database. I encounter substantial aversion to have multiple=20 applications access one database, or even the reverse: all abstraction=20 should be at the application layer. My best theory is that these communities developed at a time when=20 Windows was more dominant, and just generally it was *significantly*=20 easier to use MySQL than Postgres for many, particularly new,=20 developers. And it is pretty reasonable to adopt an aversion to=20 sophisticated use of the database in that case. This attitude has just continued to today, even as many of them have=20 switched to Postgres. This is only a hypothesis. I am now officially researching the issue. I=20 would be grateful for any wisdom from this community. Aside: it is rare to find a situation in life or anywhere where one=20 widely adopted thing is worse in *every way* than another thing, but=20 this certainly was and largely still continues to be the case when one=20 compares MySQL and Postgres. So why do folks continue to use MySQL? I=20 find this mystifying. =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D Hi there. This issue is close to my heart and I'm with you.=C2=A0 I am=20 however very comfortable with using psql and PL/pgSQL and I am very=20 opinionated. I feel *very* strongly that a database that actually matters and where=20 RI is critical, i.e., any PG db I handle, should make sense on its own=20 and be *highly* usable on its own. It should not be dependent on some=20 particular external application code to use it or make sense of things.=20 It follows that I think nonintuituve exceptions/gotchas should be=20 *clear* at a db level, likely using functions to encapsulate that=20 information. Sure, PL/pgSQL may possibly be slow at some things like doing lots of=20 bigint math, but I would probably use C and ECPG for the appropriate=20 cases. Not a large percentage of programmers these days know how fast db tasks=20 can be because they are used to working with relatively slow tools and=20 frameworks. ( Yes, typical Python.) I am also highly mystified by the dumbstore approach and frankly, I=20 think that folks should KNOW their tools better. Not knowing how to use=20 your database effectively typically results in unnecessary and often=20 very convoluted application code, from my experience. I keep hearing about db portability but I have yet to see cases where=20 db logic was an issue. But to be honest, I haven't seen many migrations=20 at all. Why? Because I think that it rarely ever happens. If I had to=20 do it, I sure as heck hope that the=C2=A0 db was "clean" and understandable= =20 without having to review some probably awful app. code. Why would anyone=20 migrate *away* from PG anyway? :) One advantage to using logic and functions in=C2=A0 the db is that you can= =20 fix things immediately without having to make new application builds.=20 That in itself is a huge advantage, IMO. Cheers, -g ---------------7657391.42080772 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable  
 
On April 8, 2018 02:40:46 pm PDT, "= ;Guyren Howe" <guyren@gmail.com> wrote:
 
I am a Rails developer at a medium-large s= ize company. I’ve mostly worked at smaller companies. I’ve some= exposure to other web development communities.

When it comes to databases, I have universally encountered the attitude tha= t one should treat the database as a dumb data bucket. There is a *very* st= rong aversion to putting much of any business logic in the database. I enco= unter substantial aversion to have multiple applications access one databas= e, or even the reverse: all abstraction should be at the application layer.=

My best theory is that these communities developed at a time when Windows w= as more dominant, and just generally it was *significantly* easier to use M= ySQL than Postgres for many, particularly new, developers. And it is pretty= reasonable to adopt an aversion to sophisticated use of the database in th= at case.

This attitude has just continued to today, even as many of them have switch= ed to Postgres.

This is only a hypothesis. I am now officially researching the issue. I wou= ld be grateful for any wisdom from this community.


Aside: it is rare to find a situation in life or anywhere where one widely = adopted thing is worse in *every way* than another thing, but this certainl= y was and largely still continues to be the case when one compares MySQL an= d Postgres. So why do folks continue to use MySQL? I find this mystifying.<= br />
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D

Hi there. This issue is close to my heart and I'm with you.  I am = however very comfortable with using psql and PL/pgSQL and I am very opinion= ated.
I feel *very* strongly that a database that actually matters and where RI i= s critical, i.e., any PG db I handle, should make sense on its own and be *= highly* usable on its own. It should not be dependent on some particular ex= ternal application code to use it or make sense of things. It follows that = I think nonintuituve exceptions/gotchas should be *clear* at a db level, li= kely using functions to encapsulate that information.

Sure, PL/pgSQL may possibly be slow at some things like doing lots of bigin= t math, but I would probably use C and ECPG for the appropriate cases.
Not a large percentage of programmers these days know how fast db tasks can= be because they are used to working with relatively slow tools and framewo= rks. ( Yes, typical Python.)

I am also highly mystified by the dumbstore approach and frankly, I think t= hat folks should KNOW their tools better. Not knowing how to use your datab= ase effectively typically results in unnecessary and often very convoluted = application code, from my experience.


I keep hearing about db portability but I have yet to see cases where db lo= gic was an issue. But to be honest, I haven't seen many migrations at a= ll. Why? Because I think that it rarely ever happens. If I had to do it, I = sure as heck hope that the  db was "clean" and understandabl= e without
having to review some probably awful app. code. Why would anyone migrate *a= way* from PG anyway? :)

One advantage to using logic and functions in  the db is that you can = fix things immediately without having to make new application builds. That = in itself is a huge advantage, IMO.

Cheers,
-g
---------------7657391.42080772-- --------------------_Boundary_85677071.7481402--