What is the best choice for the album function?

Source: Internet
Author: User
What is the best choice for the album function? There is a need to automatically classify the images in users' comments into user albums for other users to browse. in the past, image addresses were saved in the database, if you view a photo album every time, you will query the database. now, if you want to directly traverse the images under the user's photo album folder to browse the album, which method is better? Do you know what the gods understand?


Reply to discussion (solution)

We recommend that you use the previous method to save the image address to the database. Save the image to the hard disk. However, you need to associate images with users.

Can I create a folder for every user to traverse the user's album folder?

We recommend that you use the previous method to save the image address to the database. Save the image to the hard disk. However, you need to associate images with users.

Can I create a folder for every user to traverse the user's album folder?
If the table data is too big during the tangle, it will not be slow to query. it should be faster to traverse in folders.

Save the image address to json extension

Save the image address to json extension
What does it mean? White points? Are images stored in the database in json format?

The database will be queried every time you view the album.
This is normal. this is what the database does.

If the table data is big, the query will not be slow.
Take it for granted?
At most, create an index for the user ID.

It should be faster to traverse the folder.
Take it for granted again!
Database query is performed in a file, while folder traversal is performed on the hard disk.
What do you mean?

The database will be queried every time you view the album.
This is normal. this is what the database does.

If the table data is big, the query will not be slow.
Take it for granted?
At most, create an index for the user ID.

It should be faster to traverse the folder.
Take it for granted again!
Database query is performed in a file, while folder traversal is performed on the hard disk.
What do you mean?
Thanks to the moderator's answer, the user ID is indexed. I know what to do. Thank you!


Save the image address to json extension
What does it mean? White points? Are images stored in the database in json format?
Yes

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.