xidb from scratch