Deploying multi-tenant on Amazon RDS (individual DB for each tenant) - laravel

I am currently conceptualizing a cloud application (SaaS) and I am looking to create a DB for every user (tenant) that is registering an account.
May I know if it is programmatically possible to create a new DB on Amazon RDS through API or anything?

Databases are created on RDS using standard SQL DDL statements -- not the API.
For example:
To create additional databases, connect to the DB instance and use the SQL command CREATE DATABASE.
http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_CreateInstance.html

Related

Amazon RDS: How many Oracle instances/databases

I have a couple of questions on AWS RDS service for migrating an oracle 19c server on RHEL with 3 standalone instances and databases:
Can RDS instance support multiple oracle standalone instances/databases or only one instance?
If I have an existing RDS service running in AWS, can I migrate another on-premise oracle database to the RDS database as another oracle schema?
Have not tried it yet.
RDS for Oracle limits one instance to a single database. However you can have multiple schemas in one database.
An account can have up to 40 BYOL type Oracle RDS instances, or up to 10 instances where license is included. You can also increase these limits by contacting AWS support.
See here for more details.
Each RDS instance equals one database. However, you can set up multiple RDS instances, if you want to.
For migrations, please have a look at the Database Migration Service (DMS). Regarding your schema in particular, please check the Schema Conversion Tool which is a part of the DMS.
Sorry I can’t be more specific as the questions are rather vague themselves.

Reverse Engineer CLI for Existing Oracle RDS Database

Is there are way to reverse engineer CLI for an existing Oracle RDS Database ?
I already have an existing Oracle RDS Database and want to create another one with exact same parameters ( except database name ).
Instead of using GUI, I want to use CLI ( "aws rds create-db-instance" ).
You could use describe-db-instances to get detailed information about your existing db instance. Then, based on the information obtained, you could create new db instance using create-db-instance.
If this is something that you will be doing often (i.e. creating same instances), it would be better to look into CloudFormation. This would allow you to provision reproducible db instances across different regions and accounts.

Is it possible to obtain a DBA privelege at AWS Oracle?

I've created a Oracle DB instance in Amazon cloud. I need to be able to create programmatically a db schema and an owner for this schema. How this could be done?
If you have credentials of a user which has permissions to create schema and user; u should be able to do this.
Programmatically create a JDBC Connection using that user; and execute same SQL Query just like you would do on TOAD.
When you create a DB in Amazon RDS, you also have to specify the credentials of the DB administrator. You can then use those credentials to connect to the DB instance and perform any administration tasks. You may also connect using those credentials and create more users with dba privileges.
There are restrictions in AWS RDS that you would not be able to do (e.g. RMAN is not supported, or Java XA is disabled and you cannot enable it, etc.). But if all you need is to programmatically create DB schemas, there are no restrictions on that.

AWS DMS - incremental migration from Oracle to Redshift

I am new to AWS DMS service. Plans are to migrate on-prem Oracle to Redshift. Before going into production environment, currently trying out a test Oracle RDS in AWS which is a small subset of actual database as source. So far have been successful in the bulk load and incremental migration from RDS to Redshift.
When it comes to on-prem oracle , particularly for the incremental load
1) As per document : http://docs.aws.amazon.com/dms/latest/sbs/CHAP_On-PremOracle2Aurora.Steps.ConfigureOracle.html, the on-prem needs to be enabled with supplemental logging. Plans are to use the following two commands.
ALTER DATABASE ADD SUPPLEMENTAL LOG DATA;
ALTER DATABASE ADD SUPPLEMENTAL LOG DATA (PRIMARY KEY) COLUMNS;
The production database has multiple logging locations. Is there any other log settings other than the above two that I should be looking into for DMS to pick up multiple log locations?
2) In the same link given, point 4 says 'Create or configure a database account to be used by AWS DMS.'
Where should I create this user? on-prem oracle or AWS?
How do I configure DMS to use this user?
You need to read this documentation:
https://docs.aws.amazon.com/dms/latest/userguide/CHAP_Source.Oracle.html
For your second question; You need to create a user in the Oracle source database, the section 'Working with a Self-Managed Oracle Database as a Source for AWS DMS' tells you all of the grants you need to give.
For your first question, if you look at the SQL Server documentation;
https://docs.aws.amazon.com/dms/latest/userguide/CHAP_Source.SQLServer.html
It specifies the limitation of; 'SQL Server backup to multiple disks isn't supported. If the backup is defined to write the database backup to multiple files over different disks, AWS DMS can't read the data and the AWS DMS task fails.'
I can't see a similar stipulation in the oracle documentation, first link, I would hazard a guess that DMS is able, in the case of oracle, to determine and cope with multiple logging locations from a configuration value inside the database.

AWS: what action in policy for making Lambda write to Aurora?

I need to create a IAM role a Lambda can assume to perform an insert statement to an Aurora RDS...still in the RDS actions nothing appears to correspond to read/write access.
How to control that access???
You do not manage this kind of permission via IAM.
IAM permissions related to Amazon RDS are about the management of RDS itself: management of instances, cluster, snapshots etc...
The authorization to perform an insert statement is defined for your database user. As Amazon Aurora is designed to be compatible with MySQL 5.6, you should manage user permissions like you would do with MySQL.

Resources