Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iXYPA-0004In-7R for pgsql-general@arkaria.postgresql.org; Wed, 20 Nov 2019 22:24:56 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iXYP6-0000vu-Vq for pgsql-general@arkaria.postgresql.org; Wed, 20 Nov 2019 22:24:52 +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_SHA1:256) (Exim 4.89) (envelope-from ) id 1iXYP6-0000vn-Jj for pgsql-general@lists.postgresql.org; Wed, 20 Nov 2019 22:24:52 +0000 Received: from mail-oi1-x233.google.com ([2607:f8b0:4864:20::233]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iXYOy-0008Jm-UC for pgsql-general@lists.postgresql.org; Wed, 20 Nov 2019 22:24:51 +0000 Received: by mail-oi1-x233.google.com with SMTP id n14so1273745oie.13 for ; Wed, 20 Nov 2019 14:24:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language; bh=4j8k5j3qjCkjB/REwB4y7vMcx5kI/nnB9kMFhe4IHnI=; b=VPQqDCI41xiwtcz0cbD2Tb8bJ5quZcDPPsy2up93tqsZHmOpsJdpCXtsU0LrNOj7UI oAq3MxHgkJzi0m6brNTLU9SMbRUxkrup+p891sqQ80X5EM/ysJa0LyiJsb9VCKz1/eRf sNM88FqwPtfln4R+qLFSlFzA9/IZIMMxlVMhMGEmh0z2Zqign+tv1mUzotRJVL6rsbC4 uFeJAROppwjzgjXBczXHIEHHhZypyuBmWhNIfXU3GWqqc0etaQ+ikCUrTxL4D3orspyW fEuAXBQkwMx3lpLqUo8+q6cuIyJyDa8iSKactEyKnMZdj1pb4aYLWiHHi8b77hCMNu0A fmXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language; bh=4j8k5j3qjCkjB/REwB4y7vMcx5kI/nnB9kMFhe4IHnI=; b=UwMFxaoedaHbe0YsRTtiKO9mKHkD2pzCwtHHB/7DtaOnxkal+5GuncLUZES3VQ2ZMz OuUgExNAH8Ph8qKqfXTbEA+yGOYTPek3SeOEHuW1K4NzKAGTQcE+GuLBQb5+2rEiUJL4 Vcl/LNHSjJh1P0moLZii5xuChp9qIifugXjIlMLg7fkwzbvxKii58wJrg4btFDTLXPx0 5QvQl51lLyUR3UtFVKjGvY8V0WP3Ju6LED3t38h1PPXsvSFOQCawxOs6YtOMxxnlNj2D nawc9Jn7aOY3ALkIjshT/mYSYLZ1exuWR8EGuRjmeeZZ20S5n3dqiT0wMQkhFeWzB6S0 lrmA== X-Gm-Message-State: APjAAAW8mnXKSqN5M+iaPqAc7qXgOI+uzovQrIybaE/qQuH83MnuobcM eXhUnjrJ62LhV2YalPgYAlHhGKjM6qU= X-Google-Smtp-Source: APXvYqwH6xkwJJGX8TNj5sQrsd/eZP4cIQxXXwQxTbBraEGmXNDiDQohbZMikTal2X9fiIm3uv0OIA== X-Received: by 2002:a05:6808:ab4:: with SMTP id r20mr4935596oij.166.1574288682268; Wed, 20 Nov 2019 14:24:42 -0800 (PST) Received: from [192.168.1.10] (ip70-186-126-197.no.no.cox.net. [70.186.126.197]) by smtp.googlemail.com with ESMTPSA id e62sm252711oif.12.2019.11.20.14.24.41 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 20 Nov 2019 14:24:41 -0800 (PST) Subject: Re: Isolation of multiple databse instances provided by a single postgres server To: pgsql-general@lists.postgresql.org References: <20191120220353.GA24554@panix.com> From: Ron Message-ID: Date: Wed, 20 Nov 2019 16:24:40 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: <20191120220353.GA24554@panix.com> Content-Type: multipart/alternative; boundary="------------851FA300AD31150884A7BECC" Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk This is a multi-part message in MIME format. --------------851FA300AD31150884A7BECC Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit On 11/20/19 4:03 PM, stan wrote: > I am working on a fairly small application to use for managing a companies > business. > > I have a "production" instance hosted by one of the cloud providers, and 2 > other instances. This is fairly new to me. In the past, I have created > applications by keeping a set of scripts that can be used to rebuild the > database, and pg_dump to restore the date. Based on some recommendations I > am using pg_basebackup to backup the production instance nightly. My > background is primarily Oracle. I realize looking at the way pg_basebackup > works that multiple database instances, provided by one server are actually > stored in the same physical OS files. > > > We have traditionally (in the Postgres world) had a sandbox, that we used > for upgrades, and testing development methodologies, and this seems to be > supported pretty well by pg_dump. > > Now that I know "too much" I am concerned about hosting the sandbox on the > same Postgres instance. What specifically do you mean by "instance"?  (I know what it means in the SQL Server world, and in Postgres all the databases accessible via a single $PGDATA are called a *cluster*.) > Recognizing that this is a fairly small application, what are wiser folks > than I recommendations? > > Should I run the sandbox from different Postgres server, possibly even on a > different machine? Is pg_dump still good way to move the production > instance to the sandbox, and perhaps even the other way around? Running CAT, STG, UAT, DEV, etc on different VMs is certainly one solution, isolating them from each other. OTOH, you can initdb multiple clusters on the same host, accessing them via different $PGDATA variables and port numbers. -- Angular momentum makes the world go 'round. --------------851FA300AD31150884A7BECC Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit On 11/20/19 4:03 PM, stan wrote:
I am working on a fairly small application to use for managing a companies
business.

I have a "production" instance hosted by one of the cloud providers, and 2
other instances. This is fairly new to me. In the past, I have created
applications by keeping a set of scripts that can be used to rebuild the
database, and pg_dump to restore the date. Based on some recommendations I
am using pg_basebackup to backup the production instance nightly. My
background is primarily Oracle. I realize looking at the way pg_basebackup
works that multiple database instances, provided by one server are actually
stored in the same physical OS files.


We have traditionally (in the Postgres world) had a sandbox, that we used
for upgrades, and testing development methodologies, and this seems to be
supported pretty well by pg_dump.

Now that I know "too much" I am concerned about hosting the sandbox on the
same Postgres instance.

What specifically do you mean by "instance"?  (I know what it means in the SQL Server world, and in Postgres all the databases accessible via a single $PGDATA are called a cluster.)

Recognizing that this is a fairly small application, what are wiser folks
than I recommendations?

Should I run the sandbox from different Postgres server, possibly even on a
different machine? Is pg_dump still  good way to move the production
instance to the sandbox, and perhaps even the other way around?

Running CAT, STG, UAT, DEV, etc on different VMs is certainly one solution, isolating them from each other.

OTOH, you can initdb multiple clusters on the same host, accessing them via different $PGDATA variables and port numbers.

--
Angular momentum makes the world go 'round.
--------------851FA300AD31150884A7BECC--