Storing process variables: Json (Spin) vs. String / what are the impacts?

@matthias.reining

some reference:Any Benefits of using Spin over Javascript Objects when using javascript Scripting

String fields have a hard limit of 4000 characters. So JSON/SPIN object is the way you want to go.

I am a heavy users of SPIN/JSON, the only major downside is that JSON variables are not indexed. So you cannot use the camunda api to search for specific variables or process instances that have a value inside of a JSON variable. The workaround for this is to store your string variables in addition to your JSON variable when you need certain data to be searchable.

Also from the Rest API side, when camunda returns a JSON variable’s value it is stringified. So you have to preform a JSON parse operation with the returns json string value. (just a extra step).

Whats the type of json data you are storing? Whats your use case?