Mike McGonagle wrote: > I have never used Blobs before, and in reading some of the literature, > I am just a bit confused. From what I am understanding, I get the > impression that a Blob is no more than the binary data from a disk > file, stored as a string of bytes in a field of the database. > > Basically, I am trying to write some multimedia stuff, and as such, > was thinking that I need to write some "filters" that access specific > types of data (a wav file, or a MIDI file, or etc.). If this is the > case, it almost sounds like it would be better to store the filename > for the data, and then let the system take care of reading the > particular format of the data.
A blob in the general sense is a lump of data that is undifferentiated (eg into characters or digits or fields etc) as far as the DBMS is concerned, just a string of bits; it serves as a catch all when you want to store anything that isn't better served by some more specialized type like text or number. Others already mentioned some advantages of storing these in the database rather than the file system, for example making it easier to organize and you don't have to worry about addressing schemes etc like filenames, or rather you sort of do but a database gives you a lot more flexibility. One big thing that wasn't mentioned is that storing things in a database can often give you improved reliability. For example, if you have several changes to your data you want to make atomically, which includes your blob data, then simply marking all the changes as a transaction means the DBMS worries about making everything atomic, and you don't have the extra book keeping and hassle of doing that yourself, as you would if you have pieces in the file system. Now that's not to say that some file systems aren't transactional; some are, but most and typical ones are't, and many that say they are only make meta-data atomic not changes to the file content itself. -- Darren Duncan _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users