K
K
kamwork2016-11-29 12:03:02
Programming
kamwork, 2016-11-29 12:03:02

What is the best way to store product images in a separate table or in the same table in JSON?

Actually the subject .. It seems like it’s more correct to store it in a separate table, but I can’t understand why this can be useful

Answer the question

In order to leave comments, you need to log in

3 answer(s)
K
kamwork, 2016-12-18
@kamwork

For myself, in the end, I did not find any advantages in the JSON storage format.
I made a single table for pictures, and I link the necessary models through a polymorphic link.
Yes, this is 1 more query to the database, but it is easily cached.

R
Roman Mirilaczvili, 2016-11-29
@2ord

There is an opinion that it is better to store pictures simply in the file system: access to them is faster and the DBMS will not strain due to unnecessary generation of network traffic.

E
Eugene Wolf, 2016-11-29
@Wolfnsex

This can be useful if you have one picture belonging to more than one product.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question