Johor Bahru is the state capital of the state of Johor and the second largest metropolitan area in Malaysia. Most tourists don't stop here and just pass through the city on their way to or out of Singapore. JB is a major local transportation hub however. Since it is just across the causeway from Singapore, some travellers use it as a hub to visit Singapore from here (lower accommodation prices) or to board the train, bus or airplane.
Melaka (a.k.a. Malacca) is the capital of the Malaysian state of Malacca.
Traditionally, the spot where Melaka stands today was the center of Malaccan history. It was the capital of the Malaccan Sultanate and the center of the Malay world in the 15th and the 16th century before it fell to the Portuguese in 1511. Centuries of colonization by the Portuguese, Dutch and the British have shaped the architecture of the town.