In this letter, we report the impact of the barrier layer on the performance of HfO2-based conductive bridge RAM (CBRAM) devices with TeTiW as the source layer. The considerable improvement of retention in the CBRAM device using TiW as the barrier layer is attributed to the lower amount of oxygen vacancies in the switching layer, which is justified from the O1s core level in X-ray photoelectron spectroscopy analyses. Therefore, the diffusion of Te in the resistive layer of the device with the TiW barrier layer is limited even at high temperature. The TeTiW/TiW/HfO2/TiN CBRAM device provides an excellent endurance of more than 104 cycles, with an on/off ratio of 200. Such a device also features long retention for up to 104 s at 200 °C.