Why use TDB and LMDB?

William Brown wbrown at suse.de
Wed May 20 22:56:32 UTC 2020

> On 21 May 2020, at 04:46, hezekiah maina via samba-technical <samba-technical at lists.samba.org> wrote:
> Hi everyone,
> I'm still learning Samba and one of the question I haven't figured out yet
> is why
> Samba uses TDB or LMDB instead of RDBMS like Postgres or MySQL?

Throwing in my view here,

You have to remember that everything is layers. TDB or LMDB are key-value stores. Postgres is sql, but internally will have it's own key-value stores. At the level samba is at for it's LDAP server and many others like 389 ds, we use key-value stores because we are literally constructing a database, with a query engine, indexing and more. 

So the value of postgres is you have a query engine, indexing etc out of the box, but they are not modelled in the same way as LDAP requires.

This means most LDAP systems basically have their own NoSQL style DB built on a k-v store.

There was a project in the past for sqlite to have lmdb as it's k-v store, but I think it didn't get very far.

https://sqlite.org/docs.html has some great technical docs on how they implement their layers ontop of a k-v store, and their architecture. 

If you ever have any questions please let us know! 


William Brown

Senior Software Engineer, 389 Directory Server

More information about the samba-technical mailing list