Sodium nitrite began to be used in food industry in early 20th century.
Before that, saltpeter (nitrates) was used for meat preservation.
In 1920s it was established that nitrites are responsible for color and antibacterial effect.
Since 1950s usage has been strictly regulated due to potential risks.