What is the difference between Ostinato and Melody?

The difference between ostinato and melody is that “ostinato” is a piece of melody, a chord progression, or a bass figure that is repeated over and over as a musical accompaniment and “melody” is tune; sequence of notes that makes up a musical phrase.