dntree is an example implementation that shows how LDAP DNs can be stored in an lmdb database, structured as a hierarchical adjecency list.
An example showing how dntree can be used is given in dntree-example1.c
.
I was curious to learn how to use lmdb. At univention we use the back-mdb backend, which is very reliable and performant. So lmdb seems like a good choice for LDAP DN related stuff. But lmdb limits key size to 511 bytes by default. So, to use lmdb in some contexts dealing with LDAP DNs (or file paths for that matter) it is useful to map DN values to ID keys and vice versa.
The API, as defined by dntree.h
is bound to change as this experiment continues.
make
./dntree-example1 -d 3
libldap
and liblmdb
need to be installed for this.
Currently this code is maintained by the author, feedback is welcome.
Copyright 2016-2017 Univention GmbH
Copyright 2016-2017 Arvid Requate
The source code of this program is made available under the terms of the OpenLDAP Public License.
This code is derived from dn2id.c written by Howard Chu.
The code of dn2id.c has been published under OpenLDAP Public License.
A copy of that license is available online.