Database help needed

WTF_Lerize

New Member
Joined
Jun 4, 2015
Messages
7
I have been told that I should only reference the videos in the database and store the videos via other means, but the fact remains, I will still need a large database for the entire setup and where do I store the actual videos, the user data etc will also go to the database.

So, I would just like to know, can I combine AWS S3 with MySQL to achieve this?
Or can you suggest any other methods?
 

DrJohnZoidberg

Honorary Master
Joined
Jul 24, 2006
Messages
21,477
I have been told that I should only reference the videos in the database and store the videos via other means, but the fact remains, I will still need a large database for the entire setup and where do I store the actual videos, the user data etc will also go to the database.

So, I would just like to know, can I combine AWS S3 with MySQL to achieve this?
Or can you suggest any other methods?
Yes, MySQL and S3 will work fine together. You can even go with a fully AWS hosted solution and use Amazon's RDS (MySQL or other choice) for your DB.

EDIT: S3 is just one huge storage space, you can use any database with it, you just need to develop the backend so these parts can communicate properly.
 

Hamster

Resident Rodent
Joined
Aug 22, 2006
Messages
32,549
I have been told that I should only reference the videos in the database and store the videos via other means, but the fact remains, I will still need a large database for the entire setup and where do I store the actual videos, the user data etc will also go to the database.

So, I would just like to know, can I combine AWS S3 with MySQL to achieve this?
Or can you suggest any other methods?
Store videos somewhere - disk, cloud, wherever
Have a way to retrieve a video via an ID
Store ID and other metadata in database
 

gkm

Expert Member
Joined
May 10, 2005
Messages
1,505
Yes, see S3 as the big bucket in the sky where you can store big objects like videos. Then in your database just store the S3 locations (addresses/references) for the videos and also all your other user stuff.

RDS also has other benefits like backup automation etc, that could make it a good choice for your database.
 

WTF_Lerize

New Member
Joined
Jun 4, 2015
Messages
7
Thank you GKM, Hamster and Zoidberg, I appreciate all the help. I will definitely go that route and I think you for your time in this matter.
 

Swa

Honorary Master
Joined
May 4, 2012
Messages
22,849
I have been told that I should only reference the videos in the database and store the videos via other means, but the fact remains, I will still need a large database for the entire setup and where do I store the actual videos, the user data etc will also go to the database.

So, I would just like to know, can I combine AWS S3 with MySQL to achieve this?
Or can you suggest any other methods?
Store videos as normal files. Use a directory tree with subdivisions. So if you have a file named file.wmv it would be stored as /f/i/l/file.wmv. You don't need to use just 3 divisions and can use more if you'll have more videos so it doesn't slow down disk operations with lots of files in one directory. Store the filenames in your database. Try to use fixed length fields. If you use a variable length field it turns each row into a variable length and slows down operations. I doubt you'll be storing a lot of data unless you go the way of Youtube.
 

gkm

Expert Member
Joined
May 10, 2005
Messages
1,505
If you store the videos on your server, then I agree with Swa, use a nice nested directory structure. Storing all the videos in the same directory will end sadly. But just a word of caution, that is you are going to stream from that server, the server may end up in significant pain in terms of disk and network bandwidth. Hence, why I think you should rather offload that pain to Amazon S3.

MariaDB is a MySQL variant. All the same considerations apply. Percona and MariaDB are both good choices for MySQL.
 
Top