How should the server save the video uploaded by the user?

Source: Internet
Author: User
Mainly want to know how to store the directory should be set, some people say it is best to follow such public/video/2015/01/20/video.mp4Then put this video information including the video directory stored in the database. Say is because a folder too many files, read the time will be very slow, to follow the date to create a folder, do you think so good? Or is there a better way? Will the user ID of the uploaded video just be bound in the database? Don't need to build a user ID folder to put the video?

Reply content:

Mainly want to know how to store the directory should be set, someone said it is best to follow this public/video/2015/01/20/video.mp4 and then put this video information including the video directory stored in the database. Say is because a folder too many files, read the time will be very slow, to follow the date to create a folder, do you think so good? Or is there a better way? Will the user ID of the uploaded video just be bound in the database? Don't need to build a user ID folder to put the video?

You can use some of the distributed test files, such as Fastdfs

This kind of storage video, decisive to consider CDN

Say is because a folder too many files, read the time will be very slow, to follow the date to create a folder, do you think so good?

That's quite right.

Store video files, it is recommended to use CDN, to ensure that different nodes access video files fast enough

This mainly depends on your video file upload after the purpose is to share or just store, share, it must be CDN

I am glad to answer the landlord's question.

In the first place, it is advisable to set up different folders to store video files according to the time node. If you want to add a user ID, you can separate this:

--User1     |--2014         |--1           haha.mp4         |--2         ...     |--2015         ...     ...--User2     |--2014         |--1         ...

Do not know my answer, whether the landlord understand.

  • 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.