Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Develop multi tenant architecture #41

Open
arunans23 opened this issue Dec 12, 2020 · 2 comments
Open

Develop multi tenant architecture #41

arunans23 opened this issue Dec 12, 2020 · 2 comments
Assignees

Comments

@arunans23
Copy link
Contributor

Since this is SAAS application, we need to handle multi tenancy to successfully scale the application for multiple organizations/users.

@arunans23 arunans23 added this to the TorgoDesk-Client 1.0.0-m1 milestone Dec 12, 2020
@arunans23 arunans23 self-assigned this Dec 12, 2020
@arunans23
Copy link
Contributor Author

arunans23 commented Dec 12, 2020

As per the initial research, we can try to use AWS to do this. Below is a sample architecture diagram.

Screenshot 2020-12-13 at 01 00 13

  • We can host the Nuxt application in Amplify.
  • For the backend, we can use Lambda functions. Since Lambda functions are open, we need to use AWS API Gateway to provide access control.
  • Dynamo DB can be used as the Database with Lambda functions.
  • AWS Cognito can be used for Identity management.

Advantages

  • We can easily scale up and down based on the traffic with Lambda functions.
  • We can achieve true multi tenancy by creating separate User pools in Cognito, and having tenant ID in dynamo DB.
  • We can reduce the cost significantly. All the resources will be used only when we need it. This serverless approach helps us to eliminate unwanted costs when we are not using the server.
  • Cognito will look after all user related stuff. (Signup mail, password recovery etc)

Disadvantages

  • We might have to rewrite the adonis backend in Node (or Python, Go, Java)
  • We will be tightly depending on AWS
  • Since most of the things are handled by AWS, we might miss out the opportunity to learn certain new things.

@arunans23
Copy link
Contributor Author

arunans23 commented Dec 13, 2020

To do a complete POC, need to complete the following steps.

  • Rethink our Relational Data with a NoSQL approach. Consider only what we have now in our database. (We can always go for a RDMS service instead of DynamoDB if this fails)
  • Try adding tenant ID in the dynamoDB tables
  • Rewrite our Adonis controllers as Lambda functions
  • Create User pools which helps for tenant architecture
  • Use AWS gateway to route traffic to lambda functions
  • Rewrite the login page with Amplify modules to support Cognito login
  • Implement Sign Up confirmation & Forgot password feature. (We can forget 3rd party login support for now)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant