The Slum takes place in the neighborhood of Botafogo, in Rio de Janeiro, from the 1870s, when slavery was still legal, and it was published in 1890, two years after the Lei Áurea. The book shows the city of Portuguese immigrants, grocery stores, quarries and tenements, with an abolitionist movement beginning to take shape.
The narrator dates the action by the law: he speaks of the "abolitionist movement that was beginning to form around the Rio Branco law", the Free Womb Law of September 28, 1871. Slavery is therefore part of the plot: Bertoleza believes herself free because of a false letter and, years later, can be claimed by the son of her former owner "in the name of the law". The Lei Áurea, of May 13, 1888, predates the book, and the final scene, with the enslaved woman returned and a commission of abolitionists at the door, mixes two eras: the novel was written shortly after the end of slavery, about a time when it still held sway.
The Portuguese are everywhere. João Romão, Miranda and Jerônimo are Portuguese, and the book records what was common in nineteenth-century Rio: immigrants who dominated retail trade and, like Miranda, got rich in import trade. The Portuguese government customarily granted titles to wealthy emigrants, and that is how the newspaper announces that Miranda was honored with the title of Baron of Freixal. The rivalry between Brazilians and Portuguese appears in the fight between Piedade and Rita, but it disappears when the tenement catches fire.
The tenement of the title was a real collective dwelling of that city: little houses around a courtyard, washtubs for laundry, rent by room. João Romão himself dreams of "a monstrous tenement" that will kill "all that vermin of tenements spreading through Botafogo", and the book records the yellow fever that kills two Italian residents. In 1893, three years after the novel, the city government tore down the most famous of them, Cabeça de Porco, in downtown Rio. The book was published months after the proclamation of the Republic.