This is slightly off topic, but this is no small DIY job.
I went down this path on my 2011 iMac thinking I'd save some serious money (SSDs were $$$ back then). After doing loads of research, in the end I strapped a thunderbolt external drive with SSD inside to the back of the Mac and booted off that.
Putting aside the 50 screws you have to remove just to get inside the Mac, there were just too many little annoying issues (e.g. hard drive fans spinning to full when using third party drives hence needing a special cable or software to get around it). These things all added up and made the whole project not worthwhile (considering I needed 100% reliability on the machine).
I'm not sure where the 5K iMac is at, but knowing Apple is becoming more proprietary with hardware connectors, there is a higher chance for unforeseen annoying issues when attempting such DIY projects.