From Persia, by way of India
Biryani has a Persian name and an Indian upbringing. It came to Singapore with Indian-Muslim traders and cooks, and stayed to become Malay wedding food.
The word is Persian. It is usually derived either from birinj, rice, or from biryan, to fry or roast; scholars have not settled which. The dish as we know it took shape in India under Muslim rule, where Persian ways of cooking rice with meat met Indian spices.
Its exact beginnings are not recorded. There are popular stories, of army cooks and of a Mughal empress, but they are legends. What can be said is that by the time of the later Mughals, rice and meat cooked together in a sealed pot was court food, and that as the empire broke up, its cooks carried the dish to regional courts, which each made it their own.

The regional schools
Hyderabad layers raw marinated meat under part-cooked rice and cooks both together. Lucknow cooks the meat first and is gentler with spice. Kolkata adds potato. The Malabar coast uses a short-grained rice and a great deal of fried onion. Tamil Muslim towns have their own versions with small-grained seeraga samba rice.
It was mostly Tamil and Malabar Muslims who brought the dish to the Straits Settlements in the nineteenth century, and their taste for a wet, strongly spiced masala shaped the Singapore style.
Three ingredients of the story
The name, the taste for long-grain rice and the technique of steaming it in a sealed pot came with Persian court culture.
Indian spices, yoghurt and fried onions, and slow cooking under a lid sealed with dough.
Indian-Muslim cooks in Singapore and Malaya added achar and dalcha, and Malays took the dish up for weddings.
How it became Malay as well
In Singapore and Malaysia biryani crossed from the Indian-Muslim community to the Malay one long ago. Nasi briyani is one of the standard dishes of a Malay wedding feast, cooked in huge pots for hundreds of guests. Johor has its own briyani gam, cooked in a single pot.
Where it is eaten
Mild, perfumed, the meat cooked first.
Raw marinated meat and rice cooked together under a seal.
Short-grained rice, more chilli, more fried onion.
Coloured rice, thick masala, achar and dalcha.