The Outer Boundary
The city has a clearly defined edge. In medieval times this was a hard defensive wall; today the boundary is less distinct and more likely to be a ring road, but the principle is the same. Healthy and productive life can carry on within the city, in the shelter offered by the boundary.
In the cell, an outer membrane - called the plasma membrane - performs a similar function to the city wall. It completely surrounds the cell and provides the boundary between one cell and the next. It is constructed, not from bricks and mortar, but from molecules called lipids. These lipids come back-to-back, and form a thin, flexible, but strong covering.
The outer boundary of the city is not, of course, continuous. For the city to survive materials, and people, have both to enter and to leave. In some cases, such as very heavy lorries, it is sensible to prevent them from entering at all.
The cell membrane too must allow materials into and out of the cell. It is important that fuel, raw materials and some signalling molecules can cross the membrane, and that waste products and some manufactured goods can leave. Other materials must be prevented from crossing the membrane at all. Therefore, within the membrane there are small groups of proteins that form gates. There are different types of gate designed to allow the free passage of different types of molecules.