From stochastic single atomic switch to nanoscale resistive memory device.