Implement simple encoded storage in gateway