Proper way to relate my nodejs server to PaaS based MongoDB?

Hi Charmers,

I have a NodeJS + FrontendJS full stack deployed via Juju Charm… I can relate that charm with a Mongodb charm that deploys a local mongodb instance… all is well. However when we goto the public cloud, we don’t/can’t manage mongodb ourselves… so we want to relate our production system to a managed service (MongoDB Atlas)… my question is the following

  1. I could just put the config/credentials into the nodejs charm as part of it’s config
    but is there benefit to “charming” the MongoDB Atlas into it’s own sort of charm?

  2. I could write a microservice which interacts with MongoDB Atlas’s API via REST …

I could relate my nodejs app in a bundle for Prod with this mongoatlas… and within the mongodb atlas charm embed both

  • a RESTful client which I install
  • the credentials my nodejs needs just to connect itself to the PaaS managed MongoDB

… or are these two separate things usually? And I should put the connection config right in my nodejs charm only?