What is the best way to use the album feature?

Source: Internet
Author: User
Now there is a need to put the user comments in the picture automatically categorized as user photo album to facilitate other users to browse, previously there is a picture address in the database, if every time you view the album will query the database, now want to go directly through the User album folder below the picture to browse the album, which Way is better? I wonder if the gods can understand?


Reply to discussion (solution)

Suggest you still do in the way of the previous, picture address in the database inside. The picture is saved in the hard drive. But you need to associate the picture with the user.

To traverse the user album folder, is it difficult for each user to build a folder?

Suggest you still do in the way of the previous, picture address in the database inside. The picture is saved in the hard drive. But you need to associate the picture with the user.

To traverse the user album folder, is it difficult for each user to build a folder?
Now the tangled time if the table data is large, then the query is not very slow, if the folder traversal should be more quickly

Storing the image address in JSON extension

Storing the image address in JSON extension
What do you mean? Can you explain the white point? Images are stored in JSON format in the database?

Query the database every time you view the album.
This is normal, the database is to do this, tired not to die

If the table data is large, then the query time is not very slow
Do you take it for granted?
Make an index to the user ID at most

It should be quicker to traverse the folder.
It's taken for granted!
A database query is made in a file, and the folder traversal is done on the hard disk.
You say that fast?

Query the database every time you view the album.
This is normal, the database is to do this, tired not to die

If the table data is large, then the query time is not very slow
Do you take it for granted?
Make an index to the user ID at most

It should be quicker to traverse the folder.
It's taken for granted!
A database query is made in a file, and the folder traversal is done on the hard disk.
You say that fast?
Thanks to the moderator's answer, the user ID is indexed. I know how to do it. Thanks a lot!


Storing the image address in JSON extension
What do you mean? Can you explain the white point? Images are stored in JSON format in the database?
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.