Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1olAcF-0007je-HZ for pgsql-general@arkaria.postgresql.org; Wed, 19 Oct 2022 15:04:19 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1olAcE-0005ab-0y for pgsql-general@arkaria.postgresql.org; Wed, 19 Oct 2022 15:04:18 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1olAcD-0005aA-CY for pgsql-general@lists.postgresql.org; Wed, 19 Oct 2022 15:04:17 +0000 Received: from mail-oi1-x22a.google.com ([2607:f8b0:4864:20::22a]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1olAcA-00074x-Hb for pgsql-general@lists.postgresql.org; Wed, 19 Oct 2022 15:04:16 +0000 Received: by mail-oi1-x22a.google.com with SMTP id j188so19545441oih.4 for ; Wed, 19 Oct 2022 08:04:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=in-reply-to:from:references:to:content-language:subject:user-agent :mime-version:date:message-id:from:to:cc:subject:date:message-id :reply-to; bh=XqMynIt0yghHCCie7HOdYcuOBiQtreSmi9HhVm5rry4=; b=njoXuoSGhpqVLXSn1uWEJZKaB/ub7HF2196YWmy4gf6fVLWHSl3Ogd3Hiqi8hbrnGa fQa34zatei5VAB8gLl03z/N5IJhaRkZCJCPIJ3gfxf1LMBRpI1EeeL4Mev9FMkrS2oO3 u1wAByLw5+iAEE6Gyly4eV209VCkj2wSbAkhVyF6t2Ca67PBKQ5x6gVBp7p09nw1HQNt XVsA/yr5pAU20H5CygvLepC1sgibJYb6yi+4yymN/slHd/EKYuUVGCsSxECxCumysrmT Xzaqx3GUtF2o0DnIcHefFiBPiKn8b3yMjL8ogo1PhYb2/sdy/KPpaorn4JykNCM1sdwt Dakg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:from:references:to:content-language:subject:user-agent :mime-version:date:message-id:x-gm-message-state:from:to:cc:subject :date:message-id:reply-to; bh=XqMynIt0yghHCCie7HOdYcuOBiQtreSmi9HhVm5rry4=; b=WwAs7ed5pSFHwyGc5sTfXXnVNFFXRFe568Bowug0w1ctluQUBF0QptYf5yonQDATLn MeJmjyR3+X6lwcQgRe014GId8NmAQafyZCXt1z4Tt7IMK1ALJODTFS4Q0zebP9XS5jOT 4vM1QAdbSqXsf3Bx/HMx7vUHPERxmPVxEseI+nKuQJW2wk4OPXTBC9QpnQbpmWE5yYQG MjNdKwokoUWk6WRFuomnC9uItTHc5Gz+yEjGhfUUx1GqDU0+LXoqUvo6bKpVUovlvy3X 1+1r/bxfhkOpdWvpkP/4nKbSob1cwv02nl7/x9vr+O6MWa2SIEUlPbJ84/EAaXsj3bdR jUgQ== X-Gm-Message-State: ACrzQf0zpZjZMxovEqyG8eT+x9hF4u3sevhpMyUWYanDwwlRLWQtquDd S2PQmGsht8+TJr8u9YdUkcahCrAU18U= X-Google-Smtp-Source: AMsMyM4Qs0AntC89BUEeu/M1LNhnSj1hKGAzunw3VEJhW/UW2FaMxNxh1lxqdE+J57nhjmWweZtbcQ== X-Received: by 2002:a05:6808:124e:b0:345:b825:fe9f with SMTP id o14-20020a056808124e00b00345b825fe9fmr4604311oiv.142.1666191852428; Wed, 19 Oct 2022 08:04:12 -0700 (PDT) Received: from [192.168.88.10] (ip68-11-68-85.no.no.cox.net. [68.11.68.85]) by smtp.googlemail.com with ESMTPSA id u78-20020acaab51000000b0034d8abf42f1sm6926161oie.23.2022.10.19.08.04.11 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 19 Oct 2022 08:04:11 -0700 (PDT) Content-Type: multipart/alternative; boundary="------------dNVFBbr5lacihi1Kwxi2cHRo" Message-ID: Date: Wed, 19 Oct 2022 10:04:10 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.2 Subject: Re: How to store "blobs" efficiently for small and large sizes, with random access Content-Language: en-US To: pgsql-general@lists.postgresql.org References: From: Ron In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk This is a multi-part message in MIME format. --------------dNVFBbr5lacihi1Kwxi2cHRo Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 10/19/22 06:38, Andreas Joseph Krogh wrote: > På onsdag 19. oktober 2022 kl. 13:21:38, skrev Dominique Devienne > : > > On Wed, Oct 19, 2022 at 1:00 PM Andreas Joseph Krogh > wrote: > > Ok, just something to think about; > > Thank you. I do appreciate the feedback. > > > Will your database grow beyond 10TB with blobs? > > The largest internal store I've seen (for the subset of data that goes > in the DB) is shy of 3TB. > But we are an ISV, not one of our clients, which have truly massive > scale for data. > And they don't share the exact scale of their proprietary data with me... > > > If so try to calculate how long it takes to restore, and comply with > SLA, > > and how long it would have taken to restore without the blobs. > > Something I don't quite get is why somehow backup is no longer needed > if the large blobs are external? > i.e. are you saying backups are so much more worse in PostgreSQL than > with the FS? I'm curious now. > > I'm not saying you don't need backup (or redundancy) of other systems > holding blobs, but moving them out of RDBMS makes you restore the DB to a > consistent state, and able to serve clients, faster. In my experience It's > quite unlikely that your (redundant) blob-store needs crash-recovery at > the same time you DB does. The same goes with PITR, needed because of some > logical error (like client deleted some data they shouldn't have), which > is much faster without blobs in DB and doesn't affect the blobstore at all > (if you have a smart insert/update/delete-policy there). > This is nothing to sneeze at.  Backing up a 30TB database takes a *long* time > Also, managing the PostgreSQL server will be the client's own concern > mostly. We are not into Saas here. > As hinted above, the truly massive data is already not in the DB, used > by different systems, and processed > down to the GB sized inputs all the data put in the DB is generated > from. It's a scientific data heavy environment. > And one where security of the data is paramount, for contractual and > legal reasons. Files make that harder IMHO. > > Anyways, this is straying from the main theme of this post I'm afraid. > Hopefully we can come back on the main one too. --DD > > There's a reason “everybody” advices to move blobs out of DB, I've learned. > We deal with an ISV maintaining a banking application.  It stores scanned images of checks as bytea fields in a Postgresql 9.6 database.  The next version will store the images outside of the database. > -- > *Andreas Joseph Krogh* > CTO / Partner - Visena AS > Mobile: +47 909 56 963 > andreas@visena.com > www.visena.com > -- Angular momentum makes the world go 'round. --------------dNVFBbr5lacihi1Kwxi2cHRo Content-Type: multipart/related; boundary="------------0hHndpz0P3wNFRGowBPUfwEP" --------------0hHndpz0P3wNFRGowBPUfwEP Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit On 10/19/22 06:38, Andreas Joseph Krogh wrote:
På onsdag 19. oktober 2022 kl. 13:21:38, skrev Dominique Devienne <ddevienne@gmail.com>:
On Wed, Oct 19, 2022 at 1:00 PM Andreas Joseph Krogh <andreas@visena.com> wrote:
> Ok, just something to think about;

Thank you. I do appreciate the feedback.

> Will your database grow beyond 10TB with blobs?

The largest internal store I've seen (for the subset of data that goes
in the DB) is shy of 3TB.
But we are an ISV, not one of our clients, which have truly massive
scale for data.
And they don't share the exact scale of their proprietary data with me...

> If so try to calculate how long it takes to restore, and comply with SLA,
> and how long it would have taken to restore without the blobs.

Something I don't quite get is why somehow backup is no longer needed
if the large blobs are external?
i.e. are you saying backups are so much more worse in PostgreSQL than
with the FS? I'm curious now.

I'm not saying you don't need backup (or redundancy) of other systems holding blobs, but moving them out of RDBMS makes you restore the DB to a consistent state, and able to serve clients, faster. In my experience It's quite unlikely that your (redundant) blob-store needs crash-recovery at the same time you DB does. The same goes with PITR, needed because of some logical error (like client deleted some data they shouldn't have), which is much faster without blobs in DB and doesn't affect the blobstore at all (if you have a smart insert/update/delete-policy there).


This is nothing to sneeze at.  Backing up a 30TB database takes a long time

 

Also, managing the PostgreSQL server will be the client's own concern
mostly. We are not into Saas here.
As hinted above, the truly massive data is already not in the DB, used
by different systems, and processed
down to the GB sized inputs all the data put in the DB is generated
from. It's a scientific data heavy environment.
And one where security of the data is paramount, for contractual and
legal reasons. Files make that harder IMHO.

Anyways, this is straying from the main theme of this post I'm afraid.
Hopefully we can come back on the main one too. --DD

There's a reason “everybody” advices to move blobs out of DB, I've learned.


We deal with an ISV maintaining a banking application.  It stores scanned images of checks as bytea fields in a Postgresql 9.6 database.  The next version will store the images outside of the database.

 

--
Andreas Joseph Krogh
CTO / Partner - Visena AS
Mobile: +47 909 56 963
 

--
Angular momentum makes the world go 'round.
--------------0hHndpz0P3wNFRGowBPUfwEP Content-Type: image/png; name="HjBPH0ZzYImO3Bgh.png" Content-Disposition: inline; filename="HjBPH0ZzYImO3Bgh.png" Content-Id: Content-Transfer-Encoding: base64 iVBORw0KGgoAAAANSUhEUgAAAIUAAAAYCAYAAADUIj6hAAAABHNCSVQICAgIfAhkiAAABzBJ REFUaEPtmNFxHDcMhmVP3i1VECpvnjzkVIHWFfhcgVcVRKrAUgWRK/C6Al8H3lTgy0PGbzFd Qc4VJP/HADs43q6kROeJNbOYgQACIAgCWJKng4MZ5gxUGXh0U0b+SIuF9G+EWXj2Q15vbrE/ NPtk9uub7Gfdt5mBx1NhqSEo8HshjbEUtlO2yIM9tsx5dZP9rPt2MzDZFAqZE4LGcFjdsg3s aQaHt7fY70X949OnaS+OZidDBkavD33157L4xaw2os+Mp/DAC10l2XhOCeStj0W5ajrJL8Wf Ci80Xgf9vVlrhg9yRONe/f7xI2vNsIcM7JwU9o6oGyJrLT8JOA1aX9sKP4wl94bAniukEbo/ n7YPmuTETzIab4Y9ZWCrKexd8M58lxPCvvD6aihfvexbEQoPYO8NQRO0JnddGO6FJYaVsBde 7cXj7KRk4LsqDxQzCYeGsJNgaXZe+JXkyGgWINq3Gp+bHNILz+wEYs5qH1eJrouNrpDXtk4O 6x1IvtD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