Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

what is polymorphic data? NoSQL databases

Quote from MongoDB Architecture Guide

Developers are working with applications that create massive volumes of new, rapidly changing data types — structured, semi-structured, unstructured and polymorphic data.

what are polymorphic data? Please explain for a guy with SQL background.

like image 726
Josefine Avatar asked Dec 19 '22 13:12

Josefine


1 Answers

Document-oriented database are schemaless. It mean that databases don't care about schema of the data. But each document has own schema / structure. Polymorphic data means that in one collection you have many versions of document schema (e.g. different field type, fields that occur in some documents etc.).

For example in below documents email field is string or array of string:

{
    "user": "Anna",
    "email" : "[email protected]"
}

{
    "user": "Jon",
    "email" : [
                  "[email protected]",
                  "[email protected]"
              ]
}
like image 58
Tomasz Fijałkowski Avatar answered Jan 03 '23 00:01

Tomasz Fijałkowski