LDB is an an embedded LDAP-Like database library, but not completely LDAP compliant.
It can store its database in regular files (using TDB), or talk to a standard LDAP server.
What ldb does is provide a fast database with an LDAP-like API designed to be used
within an application. In some ways it can be seen as a intermediate solution between
key-value pair databases and a real LDAP database.
LDB is the database engine used within Samba.