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.