Closed samlevin closed 9 years ago
The JSON column becomes consistent for a relation when a REPLACE occurs.
The JSON column becomes inconsistent when an UPDATE occurs.
However, this only matters when using the json
method. Because only then is the JSON column content returned as is. When using select
on a model with a JSON column, the content of that JSON column will be updated with the content of the other columns selected, ie: made consistent.
So, to recap about consistency:
update
makes the JSON column inconsistent;replace
(and insert
) makes the JSON column consistent;select
(and relate
) returns consistent data for the selected columns;json
returns eventually consistent data as fast as possible.Before using it, remember that this JSON column serves only two purposes:
If your application requires only scalars values and does not need a big speedup in the dynamic selection of eventually consistent data from an SQL database, don't use the JSON column.
Use it only if you must store non-scalars values in an SQL database or if your application would benefit from a cache of eventually consistent JSON objects.
how or why do the contents of the JSON column eventually become "consistent"? I'm still very new to the idea, and am interested in using the JSON column, but it eludes me!