top | item 28471056

(no title)

allwein | 4 years ago

It's not done using dynamic SQL tables.

The key insight is to note that FIELDS table actually defines the name, ordering, and config for each of the fields of a given note type, and that the actual notes data is stored in the Notes table in the DATA column, most likely as JSON.

discuss

order

jjice|4 years ago

To add to/reiterate the above, they use a separate table to store metadata. Whenever you see a situation in a webservice where there is a custom way to store data, it's likely that they either store metadata in a table, store is as a more lose format like JSON or XML, or a combination of both.

In my experience, most services don't make tables on the fly that are meant to hang around, since storing metadata can get you very far.

pandatigox|4 years ago

Thank you for that! How 'safe' is it to store notes data as JSON? So how can that be validated, compared to storing in table columns?