Switching to memory database