We are developing a multi-tenant SaaS knowledge repository using a monolithic architecture with Node.js. The application employs MongoDB where each document is tagged with a tenantId to separate data for each tenant.
Recently, we decided to introduce a new service developed in Python, which will retrieve files and index them in a vector database. The monolith and the new Python service communicate via NATS as a message broker.
We face the following challenge: To retrieve files from tenants’ Google Drive accounts, we require specific credentials.
Here are some constraints:
Managing tenant entities like deletion is handled by the monolithic application.
Ownership and operational logic for Google Drive credentials belong to the new Python service.
Given these constraints, we have several questions:
Should the monolithic application be responsible for storing the Google Drive credentials, or should they be managed by the Python service?
Should we propagate the concept of tenants across all our services and broadcast tenant-related events (e.g., deletion) to facilitate better integration?
We are looking for best practices and recommendations for managing shared responsibilities and data consistency across these services.
We want to understand the pros and cons of storing Google Drive credentials in the monolithic application’s database versus the Python service’s database.
We are seeking recommendations for avoiding the need to broadcast tenant events like deletions, as this would require all services to handle tenant management concerns
PedramRZM is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.