Modern technologies reached Russia several decades late, but Latvia became one of Russia‘s industrial heartlands. Riga was connected to rail network by 1860s, starting its exponential growth. ~1870s rail reached Liepāja, expanding its port and allowing the construction of a city-sized Russian naval base in 1890.
More and more Latvians left their farms for cities. Many worked in the industries, others sought for education. Lifestyles changed: birth rates declined, long work hours outside family became common. But the real game-changer was the conclusion reached by the newly-urban Latvians that their own culture was in no ways inferior to German or Russian ones (and, in fact, it has many unexplored bright sides). The great Latvian National Awakening followed, epitomized in regular Song Festivals where the songs recently considered appropriate only for uneducated peasantry now resounded over Latvia’s cities.
High culture, for centuries a privilege of some ethnic minorities, now became accessible to everybody. The rise of majority Latvian culture was overwhelming, as educated Latvians researched their history and shared their findings. While the great art nouveau edifices of ~1910 Riga were still paid for by German elite, many architects were Latvians, incorporating Latvian mythology and traditions into the designs. Latvian cities influenced far beyond Latvia, attracting students and workers from agricultural Lithuania as well as Poland. Riga was among the 5 largest cities of the Russian Empire.
As Latvian spirits were rising, the Russian Empire was shackled by economic setbacks and lost wars. In the revolutionary turmoil of the early 20th century, Latvian intellectuals dared to voice the idea of freedom and majority rule. After both Russia and Germany were defeated in World War 1, Latvians declared independence for the first time in history.