Add DB layer and code encoder/decoder.