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.