save db structure