Amazon RDS - Creating/cloning multiple databases in a single rds instance - amazon-web-services

We are developing a Java/j2ee application which uses RDS.
We want to create a separate database per customer on a single RDS instance.
We want to create a template SQL schema with tables and some metadata.
When the new customer is created we want to clone the template schema and create a separate db for that customer.
Can you let me know if this is possible using AWS SDK APIs? Or if there is any other way?
Regard,
Dattatray.

The general design for handling individual databases for multi-tenant applications would be like
Have a separate DB for identification / allocation of specific database to a particular client [ Meta Data Database ]
During a launch / on-boarding of a new client, you need to fire the SQL snippet -> with a unique Client's DB name and have this information updated in the Meta Data Database
You can think of dynamically updating the SQL snippet DB NAME and then firing the Schema for the new client or use ORM like Hibernate to create the specified Database elements.
Amazon RDS doesn't impose any restrictions on number of Databases you can created in a single instance, so you need to worry about the upper limit. You do not need to use any of the AWS SDKs or APIs you just need to concentrate on the App and Connection Strings.
Extract from AWS FAQs for RDS :
Q: How many databases or schemas can I run within a DB Instance?
RDS for MySQL: No limit imposed by software
RDS for Oracle: 1 database per instance; no limit on number of schemas per database imposed by
software
RDS for SQL Server: 30 databases per instance
RDS for PostgreSQL: No limit imposed by software

You wouldn't need to use any SDK for RDS, as you are not really modifying the instance in any way. The instance will always be running, and you just want to create new database schemas on that instance. This would be done using the SQL connector library you are using in your Java code (or could be scripted in another language such as Perl or Python for example).

Related

Run sql migrations on a clone of Postgres RDS then use that as master

I have been trying to figure out if there is a way to do the following scenario in Postgres on Amazon RDS:
Clone a production database (we have several shards across multiple regions), while keeping it in sync
Run some SQL queries to update the data in the clone (they are potentially risky and thus we need to do this on a separate database)
Run a test app instance connected to that database and do some synthetic checks and validations
If everything goes well, promote the clone to be master stop using old master and it's replicas
I see there are ways to create Read Replicas but they aren't quite helpful as I need to run some upgrades on the replica so it has to be writable.
So basically I need a sleeping clone that isn't used for reads but kept in sync and I can perform some modifications on.
Is this possible using AWS RDS?
One solution which I can think of is
Use a custom domain name for connecting to your database. Map the custom domain name to the database domain name using CNAME.
Create a new RDS instance from the latest snapshot.
Perform the DML operation and testing on the new database.
Once the test is successful promote the new database in Route53.
For using a custom domain name, please check https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/routing-to-rds-db.html

Is it possible to connect two RoR 5 websites to one amazon RDS DB with monthly costs

As stated above I want to configure two webapps hosted on heroku w/ one amazon RDS DB instance, e. g. via table_prefixes or database.yml.
Can somebody please give advice on how to do that and if it is possible at all?
Thanks!
you can create as many databases as you like on one one db.t2.micro RDS instance . just "CREATE DATABASE blah" as the admin user, create a new user for the new database and grant access. RDS doesn't care if you use a database for one app or for 1000 apps. You may run out of connection slots or other resources, but from a data perspective, these applications can be completely isolated through permissions and still share a single RDS server.

AWS DMS: simplified permissions for SQL Server when not replicating ongoing changes

I am trying to set up AWS Data Migration service for a SQL Server database (on-premise) to an RDS instance.
I am only interested in existing data, not ongoing changes, since the source DB is populated by a batch process.
DMS seems convenient but has significant prerequisites in terms of allowed access in SQL Server -- either sysadmin role, or a series of other permissions to allow access to backups and transaction logs.
Is there a simplified process in DMS (or elsewhere in AWS) that only needs sufficient access to introspect schemas and query tables on the source?

DB role in a WSO2 Identity Server Clustered Deployment

I want to set up a cluster of WSO2 Identity Servers for HA. From the documentation I understand that there can be two IS nodes which are load-balanced either through ELB or Apache.
In my case the user-store will be an Active Directory server.
My question is around the database requirements for the cluster. Given that the user store is AD, what kind of a database setup do I need? Do I need a database cluster such as MySQL (which makes sense for HA), and what would it be used for?
Your user store is AD and database can be anything. There is no any special recommendation for databases. You can use any SQL database but WSO2IS has been only tested with following database types.H2, DB2, MsSQL, MySQL, MySQL Cluster, Oracle, Oracle RAC,PostgreSQL, Informix.sql You can use any of these. But embedded H2 is not production recommended. Also database does not depend on the user store that you are using. You can use any type of user store (JDBC,AD,LDAP) and any type of database independently. As you have mentioned, it would be better, if you can have database level clustering to achieve the HA. If you are using MySQL, you can probably use the MySQL cluster, more detail would be available in the WSO2 article as well

What is the difference of SQL Server on EC2 and DBS on Amazon Web Services?

I have not used AWS yet and want to get to kinda assessment about its data center options.
My guess is that you can have a MySQL or SQL Server on an EC2 virtual box.
If DBS is Amazon data specific service, what are the differences between these two approaches:
Using DBS vs DB on EC2?
Check out this related question first.
According to Amazon's documentation:
Connect to your DB Instance using your favorite database tool or programming language. Since you have direct access to a native MySQL, Oracle or SQL Server database engine, most tools designed for these engines should work unmodified with Amazon RDS.
Basically, going the EC2 route requires a lot more maintenance in the long run. If you're using Amazon's services, and you need any one of those kind of databases, you might as well use RDS.