Should i use one data base per user on AWS RDS for MySQL?

0

I'm creating an application where each business will have;

  1. owner which is a user at some-business-name,
  2. Some information about the business (This part will actually change my app's UI)
  3. employees(Also users same as owner)
  4. permissions (for employees. Permissions for owner can't changed)
  5. customers
  6. ...

These are all unique to every business!

There is no limit on the number of businesses

I think i need a new database for each business with a unique business name (some_business_name). There is no limit on AWS RDS for MySQL based on https://aws.amazon.com/rds/faqs/ - "How many databases or schemas can I run within a DB instance?". So this should work right?

My question is:

  • Is this solution suitable for such an application?
  • What are the pros and cons?
  • Should i use DynamoDB instead?
  • Are there any articles I can use?

I'm new to MySQL, I think every answer will help me a lot. thank you 🙏

NOTE: I have to create this application using aws

profile picture
已提問 2 年前檢視次數 810 次
2 個答案
1

What you are trying to build is essentially a multi-tenant solution on AWS. Although you could have a separate database per tenant, you don't necessarily need to have a separate database per tenant, as that will be very expensive.

Here are some good blogs that talk about building multi-tenant solutions, that you can use as guidance for building what you are trying to build

  1. https://aws.amazon.com/blogs/apn/building-a-multi-tenant-saas-solution-using-aws-serverless-services/

  2. https://aws.amazon.com/blogs/database/build-and-load-test-a-multi-tenant-saas-database-proxy-solution-with-amazon-rds-proxy/

  3. https://aws.amazon.com/blogs/database/multi-tenant-data-isolation-with-postgresql-row-level-security/

profile pictureAWS
專家
已回答 2 年前
0

There is not enough information here to give a straight answer, but probably you do not want multiple schemas. If your application is expected to connect to multiple 'businesses' then you probably want a single schema. If you instead use 'per business' databases, your application will need to change the database context for each query.

AWS
管理員
已回答 2 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南