It totally depends on what exactly you are trying to achieve, how much coverage you need and how far invested you already are into Ubiquiti products.
If you don't expect to have more than 4-5 cameras then a cloud key gen 2 plus will act as your NVR for cameras and network controller for their networking products. It's biggest limiting factor is that it can only take 2.5" hard drives which limited you to 5tb.
If you just want to record smart detections then you might be able to get away with using a Gateway Max as the NVR which can have an NVME SSD, I don't recommend spending more to buy models with larger SSD's or swapping the SSD for a larger one yourself - once you are spending that kind of money, you might as well just buy a Dream Machine Pro or SE.
If you plan to have over 4 cameras or use 4k cameras then you'll need their dedicated NVR or something like a Dream Machine Pro, SE or Max to act as an NVR.