Re: Best Strategy for Large Number of Images - Mailing list pgsql-general

From Benedict Holland
Subject Re: Best Strategy for Large Number of Images
Date
Msg-id CAD+mzoyG-21b+xBYjShhbf3SofZdE-erp0ehsvyfA=v4pgtO1g@mail.gmail.com
Whole thread Raw
In response to Re: Best Strategy for Large Number of Images  (Bruce Momjian <bruce@momjian.us>)
Responses Re: Best Strategy for Large Number of Images  (Bèrto ëd Sèra <berto.d.sera@gmail.com>)
List pgsql-general
I would recommend storing a link to the file rather than the file itself. Other than that, use BLOBS. I would probably recommend not storing any binary objects in a database for a variety of reasons but if you have to then bytea will work, assuming they are smaller than 2gb. 

Thanks,
- Ben

On Wed, Dec 15, 2021, 4:41 PM Bruce Momjian <bruce@momjian.us> wrote:
On Wed, Dec 15, 2021 at 02:45:15PM -0300, 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?

You might want to read this:

        https://momjian.us/main/blogs/pgblog/2020.html#June_19_2020

--
  Bruce Momjian  <bruce@momjian.us>        https://momjian.us
  EDB                                      https://enterprisedb.com

  If only the physical world exists, free will is an illusion.



pgsql-general by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Best Strategy for Large Number of Images
Next
From: Bèrto ëd Sèra
Date:
Subject: Re: Best Strategy for Large Number of Images