Refactor memory spec to use real db