0

I am looking for an example to understand the following statement:

Schema of unstructured data can be defined at query time

1 Answer 1

0

The statement "Schema of unstructured data can be defined at query time" sounds like a little bit of poor choice of words but likely eludes to the point that all data has a structure, even if it hasn't been defined explicitly yet (such as in a relational database management system).

In the context of NoSQL, an unstructured dataset such as JSON may not explicitly define things like the data types of the data itself, but the consuming applications of that data may define the schema of that data explicitly ahead of time such as when defining models to physically represent your data as objects.

For example, TypeScript is a JavaScript framework where you can define class files to store your model definitions that deserialize the JSON data into objects, such as when you receive data back from a restful web service. Furthermore, you can then persist that data into another database system, such as SQLite for example, where the schema is materialized with different (but compatible) data types. TypeScript has the number data type whereas you could store the same data in SQLite as INTEGER or REAL depending on what fits your use case.

The point being, there is no defined schema at the source of the data, but once it's queried and consumed in an application, it is possible to define one, or even multiple schemas that appropriately fit the shape of the data.

Additionally, some applications implicitly define a schema around the data they consume, for example, with an ORM, or with data migration tools. The purpose of an ORM is to literally define concrete models for a particular set of data. While most ORMs usually consume structured data, there are unstructured ORMs as well.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.