There are numerous threads in the internet about this and people discussed about it to death..
Here are some links you should check:
Link 1[
^]
Link 2[
^]
Link 3[
^]
Here you can find detailed info about
YouTube's architecture[
^].
Have look at them and you will have an idea or a solution.
Good luck,
OI