What I've learned from 30+ years of working in poo:
NEVER build or buy a house in the low areas of town...NEVER!!! Poo water runs to the lowest area available...ALWAYS!
NEVER build on a hillside in town...NEVER!!! Storm water will run THROUGH your house, on it's way down to the lowest area in town...ALWAYS!
NEVER have basement floor drains, sink drains, or washing machine drains that flow directly to the sewer main in front (or behind) your house....NEVER!!! We always referred to them as 'sewer main pressure relief overflows'....in other words, if the sewer main backs up or plugs up (and it will!), the poo water will simply flow to the lowest area it can gain access to....YOUR basement....which we referred to as 'emergency sewage holding tanks'.
The option of choice to prevent that is what's called an "overhead sewer". That is, the main sewer pipe in your house is mounted just below the floor joists of your first floor. All the water from sinks, tubs, toilets, etc. from the first floor and above drain by gravity into it. All water that comes from appliances or fixtures in the basement needs to be pumped UP into that "overhead" pipe. And since that pipe is above the level of the outside ground level, the water will flow out of it, downhill, into the city's sewer main. [-]If[/-] When the city's sewer backs up, it will flow out of the manholes in the street (or through your neighbors basement floor drains!), instead of into your house!