...
Question: When do I define service in common-services vs. stacks folders?
One would define services in the common-services folder if there is possibility of the service being used in multiple stacks. For example, almost all stacks would need the HDFS service - so instead of redefining HDFS in each stack, the one defined in common-services is referenced from multiple stack-versions. Likewise, if a service is going to be contained in only one stack and never going to be shared, it can be defined in the stacks folder. Basically services defined in stacks folder are by used containment, whereas the ones defined in common-services are used by reference.
Define Service
Components
Scripts
Command Order
...
Hooks
Configuration
...
Files
Alerts
...
Kerberos
...
Metrics
...
Widgets
Define Stack
Services
Repositories
...
Hooks
Configurations
...
Stack Advisor
...
Themes
...