Hi Team,
AEM : 6.5.12
We need to save a very BIG JSON String of size around 3.5 MB, in a node property.
What is right way to save? Just as a String data type? or should be saving as a Binary data?
Solved! Go to Solution.
Views
Replies
Total Likes
It is better to store the value as binary instead of string, for more improved performance you can upload this as dam file and refer the path of the JSON in a property.
This approach may have its impacts if your application performs search on this property.
So, I recommend to store them as binary as property itself.
Hope this is helpful!!
Hi @arvind,
Why don't you upload the JSON file as asset (just as you would upload images) and deliver access it as is? - IMHO, this would be the best way to deliver a performant AEM website than saving such a big JSON on node. References [0],[1].
However, to answer your question:
//Store content from the client JSP in the JCR Node custNode = customerRoot.addNode("customer"+firstName+lastName+custId,"nt:unstructured");
//make sure name of node is unique custNode.setProperty("id", custId); custNode.setProperty("firstName", firstName); custNode.setProperty("lastName", lastName);
References:
[0]: https://blogs.perficient.com/2021/08/16/loading-json-content-into-aem/
Hope that helps!
Regards,
Santosh
It is better to store the value as binary instead of string, for more improved performance you can upload this as dam file and refer the path of the JSON in a property.
This approach may have its impacts if your application performs search on this property.
So, I recommend to store them as binary as property itself.
Hope this is helpful!!