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 1mxZsm-0002n6-Jb for pgsql-general@arkaria.postgresql.org; Wed, 15 Dec 2021 19:24:08 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mxZsl-0005qt-B1 for pgsql-general@arkaria.postgresql.org; Wed, 15 Dec 2021 19:24:07 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mxZsl-0005qj-0g for pgsql-general@lists.postgresql.org; Wed, 15 Dec 2021 19:24:07 +0000 Received: from mail-oi1-x231.google.com ([2607:f8b0:4864:20::231]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1mxZse-0002BG-J6 for pgsql-general@lists.postgresql.org; Wed, 15 Dec 2021 19:24:06 +0000 Received: by mail-oi1-x231.google.com with SMTP id n66so33048043oia.9 for ; Wed, 15 Dec 2021 11:24:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language; bh=ANZQfMez/3PmmeS4GpCM12Sx+QVJWAC11zI4zpnUKW4=; b=aAvVL2cBUMNMDaJ7mN5zTSG6IPHBjNU6StXaqIg2gTxu/SGjaOJG4BG4DmYIfSi0dL Yp+Pxjy/2M/ej0sCP7VbrsZxdPV89axGBhZJlt7GJ/nL0WV9XqS/7jXUHm5I0R5zoyjo qPoN2sO2X/bMVB/MDFAidFV0njhP70fgk+I0GtDz7xorUoNbPNj3vX3FWvYnZKedho5S wRbUDnnDf7WZ1FB22Oj8HUl169I4NdJ08CPKyDUvmUk9i5ie7YFDliL2ZVtyUTxADcvS iH81QxocesT98gXqcwhLc87mnfESNjYynCkrpb2SaJu2C8E71SQ2x6E0o5LLEg0MptTt dHwA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language; bh=ANZQfMez/3PmmeS4GpCM12Sx+QVJWAC11zI4zpnUKW4=; b=AkbTYWv9btvpzR0cogLDpSkKvUVKgcTpNZW99TBsKP2zIHFVT8xSTOQXBRWNZmuCiI RlPARaDG9z3M/qQEe8yQ3jO1dzrDk99Mu/0JVwNtuRFXnkHFkhKPzLWDEu8oAihQtCl+ GSORHXBVWJQHMlZCf1C/7IVGIKiOW5HpbHa56t7MbUZXYqPdqz2K+XjqZkrYmPoUvaNT r6T1OsFWj5l8+ZSaCM1PP5ByJFf9iRWuUICG72b9P/Fr8cRCtw2dCEOSMiRA4rCl7D3v jrzFHSEQcdI3MQ32tQzCLh6HXAHeCW6vrsV+LfWEq1WFWOD4E13EJcf6jOk9ka1GxZXR ha8w== X-Gm-Message-State: AOAM532oRUv8qPYI73kLJaCEv7cFvm5HUFKZ9VfEHQsguH5PuFeQZn+9 WmYDpA958CJ9XgHvXyUmozOiyZIZN7s= X-Google-Smtp-Source: ABdhPJzWmPutff4+hStwfhiM0rXI655HYKdvEKADiN0VMW90E3HQq5W1LFTOwxegwS+L/pDAKJucIA== X-Received: by 2002:aca:ab8d:: with SMTP id u135mr1230155oie.83.1639596237210; Wed, 15 Dec 2021 11:23:57 -0800 (PST) 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 f12sm593498ote.75.2021.12.15.11.23.56 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 15 Dec 2021 11:23:56 -0800 (PST) Subject: Re: Best Strategy for Large Number of Images To: pgsql-general@lists.postgresql.org References: From: Ron Message-ID: Date: Wed, 15 Dec 2021 13:23:56 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/alternative; boundary="------------280FDDEC48A9D02E90736880" Content-Language: en-US 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. --------------280FDDEC48A9D02E90736880 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit On 12/15/21 11:45 AM, Estevan Rech wrote: > Hi, > > I don't currently use PostgreSQL, but I plan to migrate and I have a > question about the best way/strategy for storing images. I have about 2 > million images with a growth trend of around 1 million images per year. I > plan to store in bytea format in an isolated table. Is this recommended? > Is there another better way? We have an application which store images in the database using bytea fields.  The next version of the software will store the images externally, with the filename in the database, because filesystems just inherently do a better job at storing *lots* of files than does a database. -- Angular momentum makes the world go 'round. --------------280FDDEC48A9D02E90736880 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit On 12/15/21 11:45 AM, Estevan Rech wrote:
Hi,

I don't currently use PostgreSQL, but I plan to migrate and I have a question about the best way/strategy for storing images. I have about 2 million images with a growth trend of around 1 million images per year. I plan to store in bytea format in an isolated table. Is this recommended? Is there another better way?

We have an application which store images in the database using bytea fields.  The next version of the software will store the images externally, with the filename in the database, because filesystems just inherently do a better job at storing lots of files than does a database.

--
Angular momentum makes the world go 'round.
--------------280FDDEC48A9D02E90736880--