When selecting the wood to use for constructing a raised garden bed, or any structure that will be not only outdoors, but also in contact with the ground, it is important to select a product that will resist rot and decay. Cedar and Redwood are often good choices for use in landscaping since their oil content will help them resist rot and decay longer than pine, or other typical woods.
Juniper is a non-typical wood choice, and can be difficult to source, but for landscaping purposes it has the potential to outlast either cedar or redwood. It isn’t unheard of for juniper to last for 50 years or more, even in direct contact with the ground. In an Oregon State University study that has been ongoing since 1928, western juniper fence posts were reported to last 30+ years, longer than any other untreated western species.
For our raised garden beds, we were originally considering using 2×6 cedar planks, but we decided to switch to juniper after hearing how well it worked in out door situations, as well as noticing it was slightly cheaper than cedar.