rebuild db architecture