How should the server Save the videos uploaded by users?

Source: Internet
Author: User
The main idea is how to configure the directory for storing the video. It is suggested that the publicvideo20150120video.mp4 file be used in this case and store the video information, including the video directory, to the database. The reason is that there are too many files in a folder, and the reading process will be slow. You need to create a folder by date. The main reason is to know how to set the directory to be stored. Some people say it is best to follow this method. public/video/2015/01/20/video.mp4Then, store the video information, including the video directory, to the database. The reason is that there are too many files in a folder, and the reading will be very slow. Do you think this is the best way to create a folder by date? Or is there a better way? Do I have to bind the video upload user ID to the database? Do you not need to create a user ID folder for video placement?

Reply content:

I want to know how to set the directory to be stored. Some people say it is best to do this.public/video/2015/01/20/video.mp4Then, store the video information, including the video directory, to the database. The reason is that there are too many files in a folder, and the reading will be very slow. Do you think this is the best way to create a folder by date? Or is there a better way? Do I have to bind the video upload user ID to the database? Do you not need to create a user ID folder for video placement?

You can use distributed files such as fastdfs.

This type of video storage must be taken into consideration.CDNNow

The reason is that there are too many files in a folder, and the reading will be very slow. Do you think this is the best way to create a folder by date?

That's right.

We recommend that you use CDN to store video files so that different nodes can access video files quickly.

This mainly depends on whether your video files are shared, stored, and shared after being uploaded. CDN is required.

I'm glad to answer your questions.

First, it is advisable to create different folders to store video files based on time nodes. If you want to add a user ID, you can separate them as follows:

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

I don't know my answer. Do you understand it.

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.