1. A resistive switching device comprising: an opening disposed within a first dielectric layer; a conductive barrier layer disposed on sidewalls of the opening; a fill material comprising an inert material filling the opening and the fill material extends above the conductive barrier layer so that a top surface of the fill material is above the conductive barrier, wherein the conductive barrier comprises a metal nitride; a solid electrolyte layer disposed over the opening, the solid electrolyte layer contacting the fill material but not the conductive barrier layer, wherein the solid electrolyte layer overlaps with an entire top surface of the fill material and the conductive barrier layer; and a top electrode disposed over the solid electrolyte.