No, do not use gdbm. Probably not bdb either.
TDB allows for concurrent writes. So, if you want to store some data in a file in your application/tool/command/whatever, and there is a chance that you need concurrent writes... TDB is really the only reasonable choice I know.
You can even have distributed TDBs.
I found out about TDB while writing a persistant cache for a little tool (a qmail plugin). Since by its nature it would have concurrent writes all the time, I was aiming for something like memcached, or its disk-based version... but TDB solves the problem nicely and effortlessly.
So, if you need a flat DB (a.k.a anonymous blobs with a single index, a.k.a a hash in a file)...