How/where to save images #172

Closed
opened 2026-04-08 07:20:53 +00:00 by a24vinla · 3 comments
Collaborator

How and where should we save images that users may want to upload?

Related Issues: #24

How and where should we save images that users may want to upload? Related Issues: #24
Collaborator

There are a few different ways to do it, but from what most people recommend, cloud services like S3 or R2 would be good. S3 is older and more industry standard while R2 is cheaper, better performance and is simpler.

How it works: 1. user uploads an image, 2. backend creates a key and a temporary url, 3. the key (location in cloud) is stored in db and the temporary url is given to the user for them to send the image to the bucket/cloud service (process can be automated with code).

Cloud services cost, but there are free options to start with. Is what most professionals use. Is scalable, has security controls, automatic backups and good performance.

Other options to cloud services:

  • Storing on disk: simple to implement but tough to scale, limited space but faster retrieval, has security issues. Works by saving in dedicated folders and storing the path in db.
  • Storing outside server: more space, better performance and easy maintenance. Problem is that it is an external service and will therefore have latency concerns and can cost. Works by transferring image to external storage and saving path/url in db.

I suggest using Cloudfare's R2 solution to start with or check with customer if we already have some sort of server where stuff can be stored.

There are a few different ways to do it, but from what most people recommend, cloud services like S3 or R2 would be good. S3 is older and more industry standard while R2 is cheaper, better performance and is simpler. How it works: 1. user uploads an image, 2. backend creates a key and a temporary url, 3. the key (location in cloud) is stored in db and the temporary url is given to the user for them to send the image to the bucket/cloud service (process can be automated with code). Cloud services cost, but there are free options to start with. Is what most professionals use. Is scalable, has security controls, automatic backups and good performance. Other options to cloud services: - Storing on disk: simple to implement but tough to scale, limited space but faster retrieval, has security issues. Works by saving in dedicated folders and storing the path in db. - Storing outside server: more space, better performance and easy maintenance. Problem is that it is an external service and will therefore have latency concerns and can cost. Works by transferring image to external storage and saving path/url in db. I suggest using Cloudfare's R2 solution to start with or check with customer if we already have some sort of server where stuff can be stored.
Collaborator

What I've reviewed:
The research on where to store and how to store images.

Checks performed:
The suggested approaches and their trade offs.
If it's realistic for our current project.

Looks good, The comparison between options is clear, R2 suggested as starting point makes sense given the simpler setup and better performance.

What I've reviewed: The research on where to store and how to store images. Checks performed: The suggested approaches and their trade offs. If it's realistic for our current project. Looks good, The comparison between options is clear, R2 suggested as starting point makes sense given the simpler setup and better performance.
Collaborator

Looks good! i will close this issue.

Looks good! i will close this issue.
Sign in to join this conversation.
No milestone
No project
4 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Andras/BoundlessFlowCampus2K#172
No description provided.