2

I am working on a web app and on back-end I have a database of users, articles, and all the other stuff typically used on this kind of web apps. Articles have images that appear at the top of the article and a bunch of images in the article itself. Users also have profile images and I was wondering what if I just created a separate table for all the images ever uploaded to the server.

Would it be easier to use and would it somehow affect the efficiency?

  • Easier than what? – nnnmmm Feb 04 '18 at 19:34
  • Easier than storing user images in users table and article images in articles table –  Feb 04 '18 at 19:36
  • User uploads is a big, complex, and dangerous thing to allow. You really should be aware of that and look into some strategies. [Example](https://stackoverflow.com/a/2596311/2655263). But to your question directly, the app will scale better if you store the images in a table separate from the users and articles. You might choose to use a different storage setup for the images (compression?) than for the users or articles table. – Kevin Fichter Feb 04 '18 at 19:41
  • When you say 'store images' (in comment above), do you mean 'store file names'? – Strawberry Feb 05 '18 at 00:48
  • @Strawberry yes, file paths basically. Not blobs –  Feb 05 '18 at 19:52
  • It would be easier to use. I doubt it would make much difference to efficiency – Strawberry Feb 05 '18 at 19:57
  • @Strawberry I was just trying to figure out whether I’m learning good habits or not. Thank you –  Feb 05 '18 at 19:59

0 Answers0