What lasts longer: Data stored on non-volatile flash RAM, optical media, or magnetic disk?
Solution 1:
See Recommended Backup Media for Circa 2009? on Server Fault.
As for optical media:
DAX Archiving provides some whitepapers, which I have not read. But there's one written by Verbatim, claiming More than 100 years projected lifetime for DVD-R General.
Recently Adrian Wong of Tech ARP by accident found out that "CD-Rs that were just 7-9 years old were failing at a significant rate". So: cross your fingers.
Solution 2:
Most CDRs sold are of the low-quality variety. Race to the bottom and all that. The 100+ year predictions have turned out to be garbage in most use cases.
The only really long-term solution is custodianship of your data. Every 5-10 years you need to copy your data to a new device, verify the integrity, and make sure you still have the tools to read whatever format it is in. If the tools look like they might not be around or convenient in another 5 years, convert your data into a format which looks like it has good future potential, and keep both copies. Rinse and repeat.
This strategy requires an easy-to-read media, so tapes are probably out. DVDs are convenient these days, but aren't particularly high density. Hard drives are high density and convenient to read, but have moving parts that can go bad over time. Your most reliable bet is going to be spreading verified copies of your data over multiple mediums, rotating these as specified above.
Don't forget to verify the integrity of your data on both read and write. Bitrot does happen, and it's far more common at modern data densities than you imagine.
Solution 3:
Optical media is good because it's cheap, but I would use magnetic tape.
CDs and DVDs suppose to be readable for 25-50 years but it's very far from the truth. Even if there's no structural damage some badly written DVDs can loose their content in 2 years.
Flash memories do not discharge for many years. However, it's a relatively new technology, so they might not be tested well enough in this respect.
In contrast, magnetic tapes can be read back after 20-30 years and are designed for backup. Very high temperature (e.g. fire) will erase them, but given normal conditions they will remain intact.
Solution 4:
I'd go with the Optical Media. It should survive the varying temps and humidity the best for long-term storage. As long as it isn't scratched or broken during that time...
Solution 5:
Optical is going to be your best bet. It is the most resilient against long term conditions (such as the ones you speak of).
Magnetic will eventually lose it's data. RAM can be wiped by accident, as well as suffers from humidity and temperature.
With optical the only thing you have to worry about is structural damage, really.