thanks for your question. We are currently working on explaing plugins (MDLSITE-1661).
- module ( => /mod/xyz/)
- enrolment plugin (=> /enrol/xyz/)
- authentication plugin (=> /auth/xyz/)
- ... http://docs.moodle.org/dev/Frankenstyle#Plugin_types
- local plugin ( => /local/xyz/)
Always put /db/services.php into the /xyz/ folder. For your example I suggest to create a local plugin. Local plugins are for things that are not module/enrolement/authentication/... So you guessed right