an article contains multiple pictures. Is it better for the database to use one-to-many or json fields to save picture fields? Or is it stored in some other way?
for example, in moments, if you store it as one-to-many:
friend_circle pictures
id id
content address //string
friend_circle_id
suppose there are 9 pictures in a moments. When there are 1 million moments, the picture table has 9 million items of data. Each time you query a circle of friends, you have to go to the 9 million pictures list to go through it. Is this very inefficient?
json data can be stored above mysql5.7. If you use json to store pictures of each moments:
friend_circle
id
content
address //json:["1":"picture01.jpg","2":"picture02.jpg","3":"picture03.jpg"]
json storage will not traverse such a large picture table, but the parsing of json may take some time. In the case of a large amount of data, I feel that this method has more advantages, but I am not sure, so please help me analyze it. Thank you