3 ms·
Naive question from a person with little DB experience: Why store the metadata in JSON inside the database instead of in multiple columns in the same table? Is
by krastanov 12y ago
Naive question from a person with little DB experience: Why store the metadata in JSON inside the database instead of in multiple columns in the same table? Is this not the point of using a database?
- rietta 12y agoIt's a form of 'document storage' that allows a application to store data without the need to account for everything in the database schema.
- devmach 12y agoIf I'm not mistaken: Altering a table can be costly and may cause a performance issues, specially if you have millions of records. Rows will be most likely locked and get updated and during this process other threads should wait until related row become "free".
- ddorian43 12y agoThat only happens if you add a non-nullable column.
- sitharus 12y agoIt depends on what those columns are. For this case multiple columns are probably better, but if you're trying to search over multiple document types a JSON column could be more flexible.