4
In my system there is a registration of Professional who has the option to save the photo of Professional also, at the moment I am doing a photo conversion to Base64
with Javascript
in the front-end
and sending it to back-end
that converts to byte[]
and stored in the database in a column of the type bytea
.
At the moment I’m studying all this flow and I realized that this slows down the system because, for example, a request from front-end
to the back-end
to get a list of Professionals ends up being slow because the JSON
that comes from back-end
is very big because of the photos in Base64
.
Does anyone have any ideas that can help me get this flow faster, some other kind of image conversion instead of Base64
so that the JSON
don’t get so heavy, or some other kind of conversion that I can do in my back-end
to store in the bank.
Someone can help me?
Man Back-end
is in Java
with the framework Spring Boot
.
Man Front-end
is in Angular 7
then use Typescript/Javascript
.
Man Banco de Dados
is in PostgreSQL
When it comes to image saving, the most feasible is you to save the image in a directory on the server and save in the database only a reference to that image. Database image saving only makes the application slower to respond.
– Jorge.M
The front-end always expects Professionals to come with photo information or only in specific cases?
– Arthur Ferraz
@Jorge. M I know this but in the planning of the system I am working they decided that I could not do this.
– Bruno Eduardo
@Arthurferraz I already understood what you meant and yes I’ve been working on it since last week, I’m making the photo come only in requests q will actually use it, but I’m still looking for a solution to my problem, better conversions to save the image in the bank.
– Bruno Eduardo