Rats and other undesirables can be attracted to compost. So it is probably best to use a composting bin, if you can.
Also try to mix in some brown/carbon (leaves, shredded paper, cardboard etc) with your green/nitrogen (food scraps, grass cuttings etc), otherwise it can become a stinky swamp (anerobic).
It's possible to approach composting form a more simplistic standpoint. The listed issues are mostly specific to high density (eg. in a fixed bin) composting. If you spread it out these problems basically go away, and so do the stinky compost labor and purchasing requirements.