Typically you would want it on an SSD as the stock PS4 HDD is one of the slowest ever made, hence why you have 3-4 minute loading times (instead of the 5-10 SECONDS it would normally take).
I don’t have a PS4 and I don’t know what the USB transfer rates are, typically you would only want it on an external drive if that can assure faster speeds.
The absolute best thing to do when it comes to a PS4 would be to upgrade your stock HDD to a SSD and that would give you the best performance.