Which last longer HDD or SSD?

They both have similar lifespans. The SSD is much faster, but it's more expensive per GB. If you can live with 240 GB's of storage, I would just use a an SSD, since it's about the same price as a 1 TB HDD. Then you can always add another HDD if you find you need more storage.

https://pcpartpicker.com/products/compare/rwcMnQ,7v38TW,BNGj4D/