Home > database >  How should I store images for my website/app?
How should I store images for my website/app?

Time:03-04

My team and I (all students, this is a college project) are creating a software, that's basically 2 frontends (a website and an app) connected to a backend through an API. We have the entity user in this software, and one of its properties its image since we expect to have a lot of users, We don't think storing the images directly on the database it's the best thing.

So in this kind of cases what should we do ? What's the best practice ? (all the components are going to be deployed so local storing it's not really an option).

(We had in mind to get some 3rd party service where we could upload the images and just store the link in the DB, but is this possible? is this fine?).

CodePudding user response:

https://www.youtube.com/watch?v=XnNbizvb1uM&ab_channel=IAmTimCorey

I recommend this video, which offers insight on two ways of server storage for image associated databases.

CodePudding user response:

You can consider using cloud storage like

They have some free of charge for experiments/learnings but you also need to be aware of charge fees after some certain usages limits. They're using cloud computing, so you don't need to worry about the performance.

Another choice that you can build your own image server and serve images directly to your website. The benefits could be

  • Having the same connection directly to your website via domains (faster than cloud sometimes)
  • You can flexibly control your image sizes/types according to your image requests. For example, you can convert your images to WebP or compress them to fit users' local devices Of course, with this way, you need to have knowledge about building an image server.

CodePudding user response:

there are many different cloud storage services that you can use to host images for your project. most popular of them is imgbb & imgur . I've been using them for a long time and they work great. Both have api's which are very simple to implement. If its your first time using them, you might want to watch a tutorial on youtube . Hopefully this helped you.

  • Related