hard disk – The best long-term storage device

I'm a programmer, and I'm very interested in the history of the computer, so it bothers me that companies do not archive previous versions of software and other things. That's why I want to archive all my projects. Hello, my question is: what storage device would retain the data for longer and more reliably. The diskettes were never so reliable, the SSds die after a certain amount of use. Hard drives have a history of breaking. And the DVDs are not big enough. I do not want to use the cloud because I want to control the data. I know there is not a perfect option. Bet what device would be the least risky for the data?