flow based db design