[db] Implements lock-based and TBB-based databases.