Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1ftHXA-0000WM-0U for pgsql-general@arkaria.postgresql.org; Fri, 24 Aug 2018 19:14:12 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1ftHX8-0003ls-2e for pgsql-general@arkaria.postgresql.org; Fri, 24 Aug 2018 19:14:10 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1ftHX6-0003ll-UQ for pgsql-general@lists.postgresql.org; Fri, 24 Aug 2018 19:14:09 +0000 Received: from out1-smtp.messagingengine.com ([66.111.4.25]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1ftHX2-0006YI-81 for pgsql-general@lists.postgresql.org; Fri, 24 Aug 2018 19:14:07 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 748ED22075; Fri, 24 Aug 2018 15:14:03 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Fri, 24 Aug 2018 15:14:03 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=fm3; bh=FxU9RmQTK7yETJbd06p1uxmP7DJg6 /7u5rJ0AAq4+2E=; b=G6eW7V60FmpfA98Av0YUubaePT77xR4vr4FC3P9rUZvZy /f54iHPJ2bsmin9t0nNL0wYQFZOf+cmT/mJ3uyBFoVQM9WS+bA9ixVGlDyGoWjkS /O28+1U8Drt+j27LwDRv5SCwaTJ8GX+Ip0MlLmtQCk7ZP+xL1kBcqEua2pF4kQyE 8pIplnHptnRl/JnonsM/TSVvpXSe0mVRmSF48zfpSiwumPBPfRPxErc8A/WtG5l3 2rc//Z9TJRoooRcACRsGuqzcVXMYVTVLUOAFYLxzpTvicuSG3shalrUHSORqsJde y7q2ysJ4ObVXOetishF+c84PMQnsCHuQaRVZ4Tl2Q== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=FxU9Rm QTK7yETJbd06p1uxmP7DJg6/7u5rJ0AAq4+2E=; b=aVh4Gn3SrnlO4TU0iqHCnj EsjA8FUwtjlUsZJ2T16AwgqSBdEjhd8rODrRdxTSVDgNGwgVmGYrZg6JBWtBuIZj jcpGGhmIVnGTZKSfFF6Q8m0ouMBzmRbjqZyTbdbCBAP40BxIzYjsuzv+aGSlX5Di gGlw9S1TTCvkYiuKtYm8Fq1XQ+0k/ojTQWU8bFcZ0R6sfVzVEhzRGd1Tey/PVqRC cRguJXsrhJyb/ipyJT0jCZyN4369WpXtfCM7EqbpZGxhtXrwaFeG+68BJaFcPc2V JKPR3LcVhxMKIw76xt73i/jUMBkFB0gg4/jX9Zcsba4Hg2VC6b8q6Zsk+AedJWVQ == X-ME-Proxy: X-ME-Sender: Received: from [192.168.1.3] (unknown [71.212.134.3]) by mail.messagingengine.com (Postfix) with ESMTPA id 4BEE910269; Fri, 24 Aug 2018 15:14:02 -0400 (EDT) Subject: Re: unorthodox use of PG for a customer To: David Gauthier , richter@simkorp.com.br Cc: "pgsql-generallists.postgresql.org" References: <72b67688-9282-783b-2073-e397fbb75ca5@simkorp.com.br> From: Adrian Klaver Message-ID: Date: Fri, 24 Aug 2018 12:14:01 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 08/24/2018 12:07 PM, David Gauthier wrote: > I tried to convince him of the wisdom of one central DB.  I'll try again. > > >>So are the 58 database(stores) on the workstation going to be working > with data independent to each or is the data shared/synced between > instances? > > No, 58 workstations, each with its own DB.  There's a concept of a > "workarea" (really a dir with a lot of stuff in it) where the script > runs.  He wants to tie all the runs for any one workarea together and is > stuck on the idea that there should be a separate DB per workarea.  I > told him you could just stick all the data in the same table just with a > "workarea" column to distinguish between the workareas.  He likes the > idea of a separate DB per workarea.  He just doesn't gt it. Then a SQLite db per work area and as part of the batch rsync db file to remote server, do work on external server, rsync back to work area. > > >>I'm no expert, but I've dozens of PostgreSQL databases running mostly > without manual maintenance for years. > > Ya, I've sort of had the same experience with PG DBs.  Like the > everready bunny, they just keep on running.  But these workstations are > pretty volatile as they keep overloading them and crash them.  Of course > any DB running would die too and have to be restarted/recovered.  So the > place for  the DB is really elsewhere, on an external server that > wouldn't be subject to this volatility and crashing.  I told him about > transactions and how you could prevent partial writing of data sets. > > So far, I'm not hearing of anything that looks like a solution given the > constraints he's put on this.  Don't get me wrong, he's a very smart and > sharp software engineer.  Very smart.  But for some reason, he doesn't > like the client/server DB model which would work so nicely here.  I'm > just trying to make sure I didn't miss some sort of solution, PG or not, > that would work here. > > Thanks for your interest and input everyone ! > > > > > On Fri, Aug 24, 2018 at 2:39 PM Edson Carlos Ericksson Richter > > wrote: > > Em 24/08/2018 15:18, David Gauthier escreveu: > > Hi Everyone: > > > > I'm going to throw this internal customer request out for ideas, > even > > though I think it's a bit crazy.  I'm on the brink of telling him > it's > > impractical and/or inadvisable.  But maybe someone has a solution. > > > > He's writing a script/program that runs on a workstation and > needs to > > write data to a DB.  This process also sends work to a batch > system on > > a server farm external to the workstation that will create multiple, > > parallel jobs/processes that also have to write to the DB as > well. The > > workstation may have many of these jobs running at the same > time.  And > > there are 58 workstation which all have/use locally mounted disks > for > > this work. > > > > At first blush, this is easy.  Just create a DB on a server and have > > all those clients work with it.  But he's also adamant about having > > the DB on the same server(s) that ran the script AND on the locally > > mounted disk.  He said he doesn't want the overhead, dependencies > and > > worries of anything like an external DB with a DBA, etc... . He also > > wants this to be fast. > > My first thought was SQLite.  Apparently, they now have some sort of > > multiple, concurrent write ability.  But there's no way those batch > > jobs on remote machines are going to be able to get at the locally > > mounted disk on the workstation. So I dismissed that idea. Then I > > thought about having 58 PG installs, one per workstation, each > serving > > all the jobs pertaining to that workstation.  That could work. > But 58 > > DB instances ?  If he didn't like the ideal of one DBA, 58 can't be > > good.  Still, the DB would be on the workstation which seems to be > > what he wants. > > I can't think of anything better.  Does anyone have any ideas? > > > > Thanks in Advance ! > > > > I'm no expert, but I've dozens of PostgreSQL databases running mostly > without manual maintenance for years, just do the backups, and you > are fine. > In any way, if you need any kind of maintenance, you can program it in > your app (even backup, restore and vacuum) - it is easy to throw > administrative commands thru the available interfaces. > And if the database get out of access, no matter if it is > centralized or > remote: you will need someone phisically there to fix it. > AFAIK, you don't even PostgreSQL installer - you can run it embed if > you > wish. > > Just my2c, > > Edson > > -- Adrian Klaver adrian.klaver@aklaver.com