June 16, 2016 at 9:22 am #11301
Problem statement: Does LDAP support JSON object as an input for storage?
Description: I wanted to store json in opendj ldap server. Is there any datatype(or syntax decriptor) for storing it?
Since when we use DirectoryString for storing json, it does not consumes it.June 16, 2016 at 9:41 am #11302JnRouvignacParticipant
There is no specific support for JSON as of today.
Today you need to store JSON as a directory string, but OpenDJ does nothing beyond that, no special indexing, etc.
JSON support will be implemented in https://bugster.forgerock.org/jira/browse/OPENDJ-2860. Last time I heard about it (a long time ago) it was scheduled for 4.0.0. I do not know if this is still the case.June 16, 2016 at 10:49 am #11309
Thanks for the input.June 17, 2016 at 10:28 am #11349
@jnrouvignac is correct that you would implement this as a DirectoryString. We have found the need to do this in a couple different use cases but it comes with a certain considerations when taking this approach.
First, as @jnrouvignac mentions, there is no specific indexing on the data and depending on how large the JSON data is, I would highly recommend that you turn off all indexing on that attribute except for maybe “presence”. Otherwise you will essentially hit your index limit very quickly and make them worthless anyways.
Second, JSON data is not enforced by any schema rules in OpenDJ. Make sure you do enforcement of attributes, syntax, required/allowed, etc within your application.
Third, JSON data can grow very quickly – both horizontally (the number of entries w/JSON data) and vertically (the size of the JSON data within an entry). Plan your system resources (JVM heap, file system, etc.) accordingly.
Finally, be aware that when you make any change to anything in the JSON data (attribute name or value), you are changing the entire value of the OpenDJ attribute. In so doing, you are now replicating the entire “chunk” of information from one server to all peers in your replication topology. Plan your network accordingly.
As we have learned adding JSON values as DJ data is very flexible, but ultimately it is nothing more than just a big “sock drawer” in which you store stuff.June 17, 2016 at 10:32 am #11350
Oh, and to respond to the question of whether JSON support is targeted for a future release, the answer is yes. OpenDJ will most likely become a supported (if not the official) repository for OpenIDM. In order to do that, it must support JSON in its native form.September 22, 2016 at 6:07 pm #13210
How to migrate data from one opendj server to another opendj server? version:2.6.2September 22, 2016 at 6:14 pm #13211
You can export the dat using export-ldif and import it using import-ldif.
Alternately you can enable replication and perform real time data copy.
Keep in mind that any global acis or policies are not included in this. Only the subentries.October 14, 2016 at 4:43 pm #13703LudoModerator
We’ve added support for storing JSON objects in attributes and also matching through JSON values.
This can be tested today with the nightly builds.
The attribute with a JSON Syntax can be indexed like any other attribute, for equality.
Beware, that right now, this is fresh code and it hasn’t been stressed to the limits. I would strongly recommend it to store small JSON objects. And also, you cannot modify a JSON field, you can only replace the whole value with a new one.
The JIRA issue has an exemple on how to use JSON Syntaxes and Matching Rules
You must be logged in to reply to this topic.