Re: Images storing techniques

From: Gaetano Mendola <mendola(at)gmail(dot)com>
To: Riccardo Gobbo <riccardo(dot)gobbo(dot)2(at)studenti(dot)unipd(dot)it>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Images storing techniques
Date: 2023-03-30 09:30:37
Message-ID: CAJycT5pDkAnhgn0QFgpFoO8pPVE-xD2J4XuC5Xs3vnBKP6aTOg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I would suggest to store your images in a file system and the store paths
to those images.

You can keep files and entries in your database synced via triggers/stored
procedures (eventually written in python since pgsql doesn't allow you to
interact with the file system).

On Thu, Mar 30, 2023, 11:22 Riccardo Gobbo <
riccardo(dot)gobbo(dot)2(at)studenti(dot)unipd(dot)it> wrote:

> Good evening,
> I'm a Master degree student at University of Padua in Italy and I'm
> developing a web application as assignment for the Web application course.
>
> Context: the Web application that my group is developing would ideally be
> used to manage county side fairs where there would be foods and drinks,
> these displayed into a digital menu.
> The application uses postgre to implement a database where stores data,
> mostly strings as emails and orders but also some images (representing the
> dishes).
> The web pages are created using java servlets and jbc
>
> Question: for better performance is it better to store images as BYTEA or
> convert every image in base64 and store the generated string (so in html
> it's enough to insert the base64 string in the tag)?
> Converting an image in base64 would use a 30% more memory than storing
> directly the image's bytes, but I don't know if working with characters
> rather than bytes could have more prons than cons
>
> Thank for the time you dedicated for the answer and I apologize both for
> disturbing you and my English.
>
> Best regards, Riccardo.
>
> Computer Engineering
> Mat. 2082156
>

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message vignesh C 2023-03-30 09:45:59 Re: Support logical replication of DDLs
Previous Message Pavel Stehule 2023-03-30 08:49:46 Re: Schema variables - new implementation for Postgres 15