I am developing a website that will work a little bit like ecommerce. It is a website where people will upload picture of items they want people to buy. My challenge is that when learning Mysql database storage, I learnt that mysql can store pictures but it is better to use it for only profile pictures. Storing large amount picture in mysql will slow it down. Please, what do i use to store these pictures and how? I have learned PHP, JSON and mysql
-
1Please create a new question rather than drastically edit this one. By completely changing this question, you invalidate the answers others have posted. – Kirk Beard Mar 04 '23 at 23:34
-
@KirkBeard, i am not allowed to as new questions and my old question is flagged to be a duplicate of an already existing question – Stephen Mar 17 '23 at 21:43
-
You're not allowed to do that: you already received an answer (and duplicates), and fundamentally altering your question invalidates that answer and the listed duplicates. – Mark Rotteveel Mar 27 '23 at 09:18
1 Answers
This question comes up regularly and the short answer is: it depends. It's a question of weighing up between an "all-in-db approach" and "which component can do what best". The bias seems to be towards "store in file system". It further depends on the average size of your images and your MySQL setup. Make sure to read up on the BLOB field type and object storage in general.
From your question I can't really tell where on your developer journey you are. But given your comment it might be helpful to point out that MySQL isn't a ready-made web-app in itself. MySQL can be one element in a solution stack (LAMP for example) and be the "database part". In a web-app where front-end code collects a user's uploaded data, your code can then store this user data into a back-end system like a database, which is MySQL, or into the file-system - that's on you as developer.

- 130
- 6
-
1Thanks for your answer. It did not really answer my question maybe because i didn't ask it properly. My challenges is that people will register in this website and will be uploading pictures at different times. I need these pictures to be managed automatically by the website that is, get these images and people upload them, store them and display them automatically when needed. Just like facebook, can mysql manage such large number of pictures without difficulty and these pictures stored automatically – Stephen May 13 '22 at 20:30
-
Why the downvote? I think you expect all this to just work automagically. Do you know how web apps generally work? If not, there's a lot to learn first. MySQL will not just do what you want it to do. The other thing: can MySQL do all that, the so-called CRUD life-cycle (create/read/update/delete), for images? Yes – Micropolis May 13 '22 at 21:21