3
I have a question here of architecture:
The application we are building has a load of images pro system. They are photos of ads, and each one can upload 12 photos. These ads are dynamic, meaning they may be available today and tomorrow no more. By researching a lot, I checked two ways to do:
save the images to a local folder on the server and in the database to save only the image path. This would save a lot of space, but would make it difficult to control things, because we would have to have a rule to delete images as ads are removed. But a 900k image would have on the 900k server really. The backup would also be more complicated.
convert the images into Base64 string and record straight into the bank, which would facilitate maintenance, but in test I made the image that has 900k was with 3,88M in the base. So since there would be a lot of images, I’m afraid the server will scale too fast and we will be at a very high cost.
I did not succeed recording as Bytea.
I’m using Python 3, Django 2 and Postgressql.
If anyone has a more assertive suggestion it would be helpful.
I would recommend using a cloud service such as an AWS or Cloudflare etc
– user38174
@carlosgaddini, yes very well commented. Every application runs on an AWS. Thanks for the tip.
– Luis Francisco Varelli