The book The Slum is about the rise of the Portuguese shopkeeper João Romão, who grows rich on the work and savings of an enslaved woman, raises in Botafogo, in Rio de Janeiro, a tenement of little houses and washtubs for laundresses and, in the end, returns to captivity the woman who helped him rise, at the very moment when a commission of abolitionists comes to bring him a diploma.
It all begins with João Romão, a shop clerk who inherits from his employer the business and one conto and five hundred milreis in cash and starts living in privation. When the companion of Bertoleza, a market vendor and the slave of an old blind man, dies, he offers himself as her confidant, keeps the savings she had been gathering for her manumission and reads her a letter of freedom that he himself forged. With stone stolen from the neighboring quarry, he builds little houses and opens the "São Romão Tenement", next to the townhouse of Miranda, a Portuguese merchant who envies his neighbor and dreams of a title.
The novel does not follow only the shopkeeper: it follows the people who live in the tenement. The quarryman Jerônimo arrives from Portugal with his wife, Piedade, to run the quarry, and Rita Baiana's chorado and cooking draw him away from his life of thrift and from his wife. The rivalry between Jerônimo and Firmo, Rita's lover, ends with Firmo killed in an ambush on the beach. A rival tenement, the Cabeça-de-Gato, divides the neighborhood, and a battle between the two gangs of capoeiras ends only when the São Romão catches fire.
After the fire, João Romão takes old Libório's bottles of money, collects the insurance, rebuilds the tenement, which comes to be called São Romão Avenue, and raises a townhouse taller than Miranda's. With the marriage to the neighbor's daughter arranged, Bertoleza becomes a hindrance, and he resolves to return her to her former master.