tags:

views:

23

answers:

1

What is the advantage in storing data as an object instead of storing them in separate table columns

For example: storing an item details as Blob instead of storing the attributes separately in an items table (SKU, Name, Price etc)

+2  A: 

In general, that sort of thing is discouraged. Blob columns are intended to store data that's a large piece of binary information, like an image or the contents of a file. This is data that's only stored and retrieved; it's never queried against, indexed, or otherwise interacted with.

If you're referring to storing data that would otherwise go into a column or table (a list of some kind, for example), then it's not a good practice to employ. The database engine is designed to deal with these relationships and make storing, retrieving, querying, etc. against them simple and performant. Storing this data as a binary object means that you're ditching the optimizations that the database gives you.

My general thoughts are this: there are many people that are smarter than I am who write these RDBMS systems; do I really think that I can outsmart them when it comes to storing a simple list?

Adam Robinson