BLOB in SQL that stores a video file

I hope someone can explain how to use BLOB. I see that BLOB can be used to store video files. My question is why does a person store a video file in a BLOB in an SQL database? What are the advantages and disadvantages compared to storing pointers to the location of a video file?

+7
source share
2 answers

A few reasons.

If you are storing a file pointer on disk (presumably using the BFILE data type), you must ensure that your database is updated whenever files are moved, renamed, or deleted on disk. This is relatively common when you store such data that over time your database stops synchronizing with the file system and you get broken links and lost content.

If you store a pointer to a file on disk, you cannot use transactional semantics when dealing with multimedia. Since you cannot do something like rollback from the file system, you either have to deal with the situation where the data in the file system does not match the data in the database (i.e. someone uploaded the video to file system, but the transaction that created the author and the header in the database failed or vice versa), or you need to add additional steps to the file upload to simulate transactional semantics (i.e. load the second <> _ done. txt, which just contains the number of bytes in the actual loaded f yle. This is cumbersome and error-prone, and could create problems of user-friendliness.

For many applications, accessing data in a database is the easiest way to provide it to the user. If you want to avoid giving the user a direct FTP URL for their files because they can use it to bypass some application-level protection, the easiest option is to have a database-enabled application that uses a database to retrieve data. file system, and then returns it to the middle level, which then sends data to the client. If you need to read data into the database every time the data is retrieved, it often makes sense to just store the data directly in the database and let the database read it from its data files when the user asks for it.

Finally, databases such as Oracle provide additional utilities for working with multimedia data in the database. Oracle interMedia , for example, provides a rich set of objects for interacting with video data stored in a database - you can easily mark where scenes or end begin, a tag where various topics are discussed, when a video was recorded, who recorded it, etc. . And you can integrate this search function with search across all your relational data. Of course, you could write an application on top of a database that did all these things, but then you either write a lot of code or use a different infrastructure in your application. It is often much easier to use database functionality.

+6
source

Read the following: http://www.oracle.com/us/products/database/options/spatial/039950.pdf (obviously a biased opinion, but has a few minuses (which are now fixed by the appearance of 11g)

0
source

All Articles