perfomance changes, move to postgres, get logbooks without logs so when persist it will not cause a big delay, unit test behind it