Niche: This refers to the role or function that an organism plays within its environment.
Ecosystem: This is a larger concept that includes not only the living organisms (biotic factors) but also non-living components (abiotic factors) such as water, soil, light, temperature etc.
Biodiversity:This term refers to the variety of life forms present in any given ecosystem. It can be measured on several levels including genetic diversity within a species, diversity between different species and diversity of ecosystems.