db and struct