implemented database mapping for scaling