Protect in-memory databases and collections with RWMutexes.