first version using lmdb