If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > General > Database Concepts & Design > How to store binary files in database

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-22-05, 00:19
s_de s_de is offline
Registered User
 
Join Date: Jan 2005
Posts: 1
How to store binary files in database

Hello everybody. this is my first post in this forum.
Actually i am looking for how to store binary files (like music files, doc files) inside Oracle database, specifically Oracle 10G.
If they are not physically stored, how references are made to those files?
How online music store tackles the situation with huge no. of files?
plz help.

s_de
Reply With Quote
  #2 (permalink)  
Old 01-22-05, 01:01
Vmusic Vmusic is offline
Registered User
 
Join Date: Dec 2004
Posts: 54
Binary

Hi,
ORACLE supports Binary Large Objects or BLOBs. In fact it's a data type and has been a data type since like 8i -I believe.

It is designed specifically for multi-media. That's all I know, sorry.

Hope that at least moves you in the right direction.
Vmusic
Reply With Quote
  #3 (permalink)  
Old 01-22-05, 10:08
Pat Phelan Pat Phelan is offline
Resident Curmudgeon
 
Join Date: Feb 2004
Location: In front of the computer
Posts: 12,605
At least in my experience, storing BLOBs within a database has been a poor choice. The performance impact on the end user is usually significant, if not enough to be a "deal breaker" because database engines don't often handle BLOB transfers very well.

I've had much better luck storing a reference to the BLOB, such as a URL or UNC pathname. This allows your code to use tools built for the job such as FTP to move data wholesale from one box (a server) to another (client). This also allows you to use a "divide and conquer" approach as your needs grow, so that you can have the files served up by another machine(s) when your database becomes too busy to do the job.

-PatP
Reply With Quote
  #4 (permalink)  
Old 01-22-05, 10:15
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,524
web servers have this thing called cache

when several requests are made for the same file, the web server can send it from cache rather than having to read it off the disk again

you totally destroy this if the web server doesn't have access to the file on the file system, and instead must pass a request to a database server to pull the file out of a table

of course, database servers have cache too, but the inter-server traffic can be totally avoided

and let's not even mention the client's browser cache, which can't be used if the requesting url is dynamic (e.g. playmusic.html?clip=937)
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #5 (permalink)  
Old 01-24-05, 17:49
n_i n_i is offline
:-)
 
Join Date: Jun 2003
Location: Toronto, Canada
Posts: 4,449
Quote:
Originally Posted by r937

...of course, database servers have cache too...
which most often don't cache LOBs anyway...
Reply With Quote
  #6 (permalink)  
Old 01-24-05, 18:05
urquel urquel is offline
Registered User
 
Join Date: Aug 2004
Posts: 330
How about a BIT table which holds the position and value (0 or 1) of each bit in the BLOB.... then write a program to reconstruct the binary from the query result. Of course, you will have to have a foreign key referencing a bit lookup table in order to enforce the ones and zeroes. (In case you ever want to move to ternary digits and an associated acronym)
Reply With Quote
  #7 (permalink)  
Old 01-24-05, 18:16
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,524
associated acronym!!!!!!!!!!!!!!!!

never heard that one before

urquel, you slay me

what a great sense of humour!!!!

__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #8 (permalink)  
Old 01-24-05, 18:49
Pat Phelan Pat Phelan is offline
Resident Curmudgeon
 
Join Date: Feb 2004
Location: In front of the computer
Posts: 12,605
Quote:
Originally Posted by urquel
an associated acronym
Why, I do believe I'd enjoy playing with them!

-PatP
Reply With Quote
  #9 (permalink)  
Old 01-25-05, 00:33
sco08y sco08y is offline
Registered User
 
Join Date: Oct 2002
Location: Baghdad, Iraq
Posts: 697
Quote:
Hello everybody. this is my first post in this forum.
But it's still like every other forum out there.

There are categories.

Post Oracle questions under Oracle.

Help us help you.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On