Video storage

Asked

Viewed 113 times

-2

Has a server, the user can put a title, description, can optionally upload up to 3 image and 1 video. The title and the description I know could be stored in a Mongo type bank in JSON. My question is how to store this video and image in a database without having to use a third party like Vimeo or something like that.

  • 1

    you MUST save in the BD the path to access the images and video, and let the server stream the video by the web server or stream, and not by the BD because of resource consumption. DB consumes a lot of server resources to output a file, while an apache or Nginx server does this with virtually no resources, and BD saves the way for the borwser to request, it can even save the login data if it is a restricted directory....

1 answer

-2


I’ve used image recording (never video), using a relational database.

Basically you have to declare the column as a bytea (binary) [postgres].

After you have to reassemble the file when sending to the client. With images in general we had a table with the image metadata. Name, extension, mime type, original name, size in bytes.

In my example I used the relational database, but it is also possible to write using a nosql database. Because they write a type of bson data (which is a binary representation of json).

Browser other questions tagged

You are not signed in. Login or sign up in order to post.