How do we define an ecosystem?

Ecosystem is a functional unit consisting of interacting organisms and all aspects of the environment in any area. It contains both the non-living (abiotic) and living (biotic) components.