Earth as a miniature ecosystem