New db implementation phase 1