Iris Classon
Iris Classon - In Love with Code

Stupid Question 169: LOB, BLOB and CLOB - what are those?

[To celebrate my first year of programming I will ask a ‘stupid’ questions daily on my blog for a year, to make sure I learn at least 365 new things during my second year as a developer]

LOB, when storing large objects :)

Try saying that fast 10 times! I was talking on Skype with a friend that is learning programming, and we started talking about storage and SQL server. I mentioned BLOB and after a giggle was asked what that is. For a short definition, this is how I explained it:

LOB stands for Large Object and it’s a data type that are for storing large objects. BLOB stands for Binary Large Object and is in binary format- and it’s not uncommon to see images stored that way. CLOB stands for Character Large Object and allows us to store string data in database character set format. Often BLOB is used to refer to both BLOB and CLOB

The nest question is, should we store large images as BLOB’s, or save them on a filesystem and store the path instead? That question is coming up very soon, but I would love to hear what you think :)

Comments

Leave a comment below, or by email.
pawelek
3/27/2013 7:34:56 AM
Only in BLOB:
1. because we got all information in 1 place 
2. Someone can change path
3. Somebody can don't have permission to path 
Roman Mueller
3/27/2013 7:53:00 AM
LOB in my field stands for Line-Of-Business .  I never called a Character Large Object a CLOB. In my vocabulary they are all BLOBs. No matter if they contain image (binary) or text (which at the end of the day is also binary) data.
Regarding your hinted second question:
my answer: it depends!
Want to make it easy to copy databases around? put the images into the database. Want to access the images also directly via the filesystem (browsable), put them into the filesystem and add a link to the database. but then maybe only put a relative path plus a configuration that says where to start.
Once again, my 2cts.

Roman
@Roman_D_Mueller 
Ax
3/27/2013 7:58:49 AM
Regarding images, I think it depends on how you're using them. If you can get away with lazy-loading and just run around with image metadata you can better leverage the power of the FS. If you want to push your images around with your BD backup strategy or otherwise handle them akin to the rest of your data, then BLOB it up. 
Devlin Liles
3/27/2013 8:06:49 AM
On Images I would say store the CDN link and load them to a CDN solution is the most common usage I have. Just because serving the images from the CDN reduces my database size and allows me to bypass the access issue. 


Last modified on 2013-03-26

comments powered by Disqus