Russia has a somewhat mixed record when it comes to ethnic tolerance. On the one hand before the Revolution Russian history had a surprisingly large number of prominent foreign individuals (the Romanoff family was probably as German as it was Russian), and there were many foreign citizens living and working quite successfully in St Petersburg, in particular, thanks to its proximity to Europe. Russian society was largely homogenous and distinctions tended to be class-based rather than ethnicity-based. The country’s most famous poet, the beloved Aleksandr Pushkin, was himself great-grandson of an African brought to the country as a servant by Peter the Great, and his many statues and portraits attest to this African heritage. Later, the Soviet Union was composed of a patchwork of peoples and ethnicities, and the regime made concerted efforts at providing equality of access and opportunity to its many citizens. Large numbers of African and Asian citizens of fellow socialist countries received scholarships to study here, and of course many fell in love, married and started families here. Today, some 15% of the population is estimated to belong to the country’s Muslim minority, and the city's mosque is soon to celebrate its centenary, a feat few other European cities can match. On the other hand, the word pogrom is a Russian word and the state’s relations to its Jewish citizens in the 19th and early 20th centuries was often characterized by mindless prejudice and violence. Many would also argue that the Soviet ideology was rather less successful at providing equal opportunities to all than its propaganda wanted the world to believe.
St Petersburg today is a relatively cosmopolitan city, which has large populations of ethnic communities from the Caucasus and Central Asia. In fact Russia’s recent economic success has to some extent been dependent on guest workers from these countries (known in Russian by the German loan word Gastarbeiter), who have often been willing to do the kind of low paid, dirty jobs that many locals are not willing to do (cooking, cleaning, construction, labour) and still manage to send money to their families back home. Occasionally tensions flare up between ethnic Slavs and natives of the Caucasus and Central Asia, often stoked by football hooliganism or related violence. Unfortunately there are still very active links between certain football fans and ethnicity-based political violence, and this may be especially evident in the summer months when sometimes alarming tattoos can be seen when travelling round the city.
Having said all this, most foreign tourists coming to the city and spending most of their time in the centre are unlikely to encounter any overt (or otherwise) racial discrimination. Racism is more prevalent in those areas of the country where opportunities are limited and non-Russian visitors are rare, and no special precautions are required for a trip to the city.