split mysql and mongodb setup code