replacing sql with firebase