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
Arshia
已提问 2 年前665 查看次数
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
审核人员
philaws
已回答 2 年前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则