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 :)
Leave a comment (via email)
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
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.
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