I've been researching NoSQL databases, and a common theme that comes up is that relational databases are unsuitable for storing unstructured data. For example:
Unfortunately, the rigidly defined, schema-based approach used by relational databases... is a poor fit for unstructured and semi-structured data [source]
I'm having a hard time understanding why this is. For example, if I wanted to store an image or some raw text in a relational database, could I not just store it as a text type (e.g. in a single column table or a key-value table)?
Unstructured data is information that is not arranged according to a preset data model or schema, and therefore cannot be stored in a traditional relational database or RDBMS.
Unstructured data is not organised in a pre-defined manner or does not have a pre-defined data model, thus it is not a good fit for a mainstream relational database.
One reason for this, according to Preimesberger, is that “Relational databases are not designed for change. Data in relational databases is arranged in rows and columns, with each row representing a unique entry and each column describing unique attributes.
The best example of structured data is the relational database: the data has been formatted into precisely defined fields, such as credit card numbers or address, in order to be easily queried with SQL.
My favorite example of unstructured data which is not a good fit for a relational database is the computer hardware parts database.
Imagine you have a web shop which sells computer hardware. How would your product database look?
Every product has a name
, a price
and a vendor
. But CPUs have a clock rate
, a cache size
and a # of cores
, monitors have a size
and resolution
, RAM modules have a capacity
and hard drives have also a capacity
(which can not be compared to that of RAM modules).
How would you store this data in a relational database?
product
, property
and value
which maps all the properties to the values (but what type do you use for value
when some properties are numeric and others aren't?)All three options are valid, but none of them is really satisfying.
But when you have a document-oriented database without a strict schema, it becomes a lot simpler because each entry can have any set of attributes which can have values of any type.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With