The closest thing to a self contained ecosystem is a natural planted tank. There is a book by Diane Walstead on it, worth buying. It's a low cost low-tech planted tank system... fish are healthier and happier in planted tanks (REAL PLANTS!)
I've preached that enough in this forum that if you haven't seen my posts praising planted tanks then you must not hae been reading this forum very often over the past couple months.
I LOVE having planted tanks. It's easier the fish are happier and things breed like crazy.