Background: I'm splitting a monolithic multi-tenant chat bot builder application. Each customer registers an API token for a third party API which their bot will run on such as slack/telegram/discord. They then use our service to code the "brains" behind the bots functionality.
I have identified a number of microservices such as command builders, announcement builders etc as their development cycle varies and deploying all in one go causes a lot of headaches.
Within the monolith and whilst they use a single db, the calls to the third parties is easy as the API keys are stored in a table beside the bot's profiles (username, id's etc). The existing code over the years looks to be peppered with direct calls to the APIs picking up keys from the DB as needed.
Question: I'm wondering how to handle the interactions with those third party APIs, including the storage of their keys now that I have separate services which also need to be multi-tenant aware.
I have considered creating a dedicated "notifications" style service which looks after keys and routing to correct third parties or whether sticking to isolation I duplicate key information across each service that can independently call directly as needed.Some need to be making calls based on events received from webhooks, some just sit back and run on a scheduler calling the third party API at set times.
The only reason for considering the latter is simplicity in direct calls and ownership, but there is the trade off for keeping the keys up to date (but they will very rarely change) and the risk of rate limiting if not centralised.