What are the pros and cons of Columns vs JSON when setting up module fields
1 Like
Hi! Sorry for the long delay.
In short, here is the deal:
Using JSON encodes all record values in a single JSON object, eliminating the need for dedicated columns. This makes things easier to manage (you don’t need to fiddle with the database in case you make larger changes). The downside is that performance is somewhat worse as well as longer queries in case you want to run some SQL manually. In case you want to use multi-value fields, those columns must be JSON encoded.
Using columns (or aliases) ensures each value is in a dedicated column. We recommend this whenever you’ll be working with larger data sets or you’ll be connecting external tools that may interact with the database directly.