Atomic scale switches based on solid state ionics