X-Original-To: pgsql-sql@postgresql.org Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 5E2E2474E42 for ; Wed, 26 Feb 2003 10:32:40 -0500 (EST) Received: from postgresql.org ([64.49.215.8]) by localhost (postgresql.org [64.49.215.8:10024]) (amavisd-new) with SMTP id 76194-02 for ; Wed, 26 Feb 2003 10:32:29 -0500 (EST) Received: from ll.mit.edu (LLMAIL.LL.MIT.EDU [129.55.12.40]) by postgresql.org (Postfix) with ESMTP id 016AE4758E6 for ; Wed, 26 Feb 2003 10:32:28 -0500 (EST) Received: (from smtp@localhost) by ll.mit.edu (8.11.3/8.8.8) id h1QFWVO03942 for ; Wed, 26 Feb 2003 10:32:31 -0500 (EST) Received: from sty.llan.ll.mit.edu( ), claiming to be "sty.llan" via SMTP by llpost, id smtpdAAATgaaIf; Wed Feb 26 10:32:20 2003 Date: Wed, 26 Feb 2003 10:32:20 -0500 From: george young To: pgsql-sql@postgresql.org Subject: Design Q.:logic in app or db? Message-Id: <20030226103220.6875cee9.gry@ll.mit.edu> Reply-To: gry@ll.mit.edu Organization: MIT Lincoln Laboratory X-Mailer: Sylpheed version 0.8.10 (GTK+ 1.2.10; i686-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new X-Archive-Number: 200302/582 X-Sequence-Number: 11980 I have general design question about Postgres usage: How does one decide how much, and what parts of logic should go in DB rules, triggers, functions, constraints etc, versus what should go in the application? I see postings here from people who obviously have a lot of domain logic in the DB side. I currently have almost none. I plan to set up a bunch of RI constraints to keep things clean and consistant, but what about logic that implements frequent domain operations? Brief sketch of my project: 2 developers, 4k lines of python(gtk, pygres), 2 main GUI user apps and a few read-only scripts for web display, 50 concurrent users(all local), DB performance important but not currently a problem. The main thing not done yet is to facilitate ad-hoc queries (via odbc excel etc.) from db-naive users: maybe restructuring the db to make it simpler, maybe views and functions... The data is somewhat complex in structure. -- George -- I cannot think why the whole bed of the ocean is not one solid mass of oysters, so prolific they seem. Ah, I am wandering! Strange how the brain controls the brain! -- Sherlock Holmes in "The Dying Detective"