We report the miniaturization of Ag/BiFeO3/ITO resistive random access memory (ReRAM) in the form of long-period waveguide grating, all fabricated entirely on z-cut lithium niobate (LiNbO3) substrate. The electric characterization vividly reveals a selector-like threshold-switching (TS) characteristic. It is well accepted that there are two filament formation mechanisms governing the operation of Ag/BiFeO3/ITO ReRAM, a two-side TS characteristic is typically generated when the positive and negative bias voltages are applied during the cycles. It is reasonable to believe the TS characteristic exists because the Joule heat produced during device operation cannot be dissipated effectively, resulting in the rupture of the conductive filament. To mitigate this shortcoming, replacing the BiFeO3 (BFO) layer of the original grating shape with a planar-layer structure is beneficial for heat dissipation, and this, in turn, would help to improve the characteristics of the ReRAM device by delivering the memory-switching characteristics as intended. As already mentioned, this ReRAM structure with the ITO bottom electrode fabricated over the lithium niobate waveguide can jointly serve as the long-period waveguide grating. Furthermore, when the Ag/BFO/ITO ReRAM structure's device area shrinks to 200 μm 2 , the growth path of the silver conductive filament is confined immediately above the lithium niobate waveguide. The corresponding spectral measurement shows that as the increasing number of ReRAM grating fingers are in the set state (silver conductive filaments formed), the energy of the transmission dips would decrease gradually in return, and during the reset state, the energy of the transmission dip would rise accordingly.