Should I create Separate EC2 for each database

158 Views Asked by At

I am creating one fullstack web application that will be used by different organisations (total 50+). I want to create separate database for each organisation.

Should I create separate EC2 and RDS for each organisation or what will be the best approach.

Note: Each org will have max 1000 users.

  • My plan is to use AWS elastic-beanstalk.
  • Frontend: Angular
  • Backend: Springboot

I am seeking best cost effective and best performance solution.

1

There are 1 best solutions below

0
John Rotenstein On

A database 'server' can contain multiple logical 'databases'. Therefore, you would only need one database 'server'.

When the application connects to the database server, it would specify a 'database' via the connection string. It will then only see data in that logical database.

Here is a diagram from Creating, Destroying, and Viewing Databases :: Chapter 3. PostgreSQL SQL Syntax and Use :: Part I: General PostgreSQL Use :: Postgresql :: SQL :: eTutorials.org that demonstrates the concept (a 'cluster' is the database server):

Database server hierarchy

It is better to run your database on Amazon RDS (rather than on an Amazon EC2 instance), since it is fully-managed and is easy to make backups ('Snapshots') and to restore those backups. You can also scale the database independently to the EC2 instances.