aws and elb function with mysql database - mysql

I want to ask if I have 2 identical ec2 instances each with MySQL. If i add a load balancer on the front of the ec2 instances, the databases of ec2 will have the same data or every database will have the data that process by a request? In other words with elb the databases will be synchronized somehow or every database will have different information?
Many thanks!

I would recommend using Amazon's RDS. It is easier to setup and you do not need to manage the cluster. If you really want to manage the boxes yourself I would look at configuring Galera
Here is a tutorial from Digital Ocean, but it would work on AWS as well.

Hope I don't think two EC2 instances must have same data in MySQL DB. ELB will send request to any EC2 instances so data will update in one instance and not in another instance anyway MySQL DB are not synchronized between instances.
I recommend you to use Amazon RDS service which is relational database and it offers MySQL, MSSQL, PostgreSQL, Oracle and Amazon Aurora. You can use any database and enable high availability for good performance.

Related

From localhost to aurora serverless

I'm studying the possibility to switch from an rds mysql (in use and with tables and data inside) to aurora serverless mysql to try to spend less money because the database is used for few operations. I can connect to rds mysql from my pc (dbeaver, mysql workbench and so on) without problems and I can design tables, view data, create users...
Now, I've created the new serverless db and attached to the same vpc and sec group of the first one but I can't connect to it from my pc. I've read on aws guides that there are two solutions:
use ec2 to ssh tunnel requests --> but it's a payware solution;
use cloud9 and connect via terminal --> but organizing a db in this way is not so simple as using a gui client.
For this reasons I've quite understood that serverless is not a good solution for now.
Any idea or suggest?
Thanks in advance

MySQL read replica with particular databases using AWS RDS

I have multiple RDS over AWS with multiple databases with each RDS. Now i want to configure read replica with few databases of different RDS at single destination server. But AWS doesn't allowed me this options, It allows to configure read replica of complete RDS only.
Please help me with your suggestions.
Thank you.

How to Synchronize MySQL Database from an On Premise to Amazon RDS

I am new to Amazon RDS, and looking to get answer for my question below and couldn't find the answer on stackoverflow yet.
I have a MySQL Database on premise that I want to synchronize with the MySQL Database on Amazon RDS. I understand that replication is possible with Amazon RDS, but how about continuous synchronization? Say my existing local database has one transaction that has been made, I want to synchronize just that transaction, either immediately or by schedule, so that I don't need to replicate the whole thing to RDS.
Does RDS have this feature for MySQL or any other database?
If not, what tools should I be using? EC2 + ? ?
Or is there any database that supports this so I can just run the database on EC2?
Your best (first) option should probably be the AWS Database Migration Service. This is a migration service for exactly your use-case.
If uptime is less of an issue, you could always do a mysql_dump, move that to an EC2 instance and load that into an RDS instance.

How Ruby on rails works with Amazon RDS

I have a ruby on rails run on amazon ec2, database is mySQL.
Now I want to use Amazon RDS to backup this database in case the ec2 fails.
I read through the Amazon RDS user guide,it tells how to create a DB instance.
My question is:
1.what is the relation between created DB instance and my ec2 database?
2.When the DB instance "connect" to my ec2, what will happen?
The data used to send to ec2 mySQL server will be send to DB instance?
Is the database totally shifted to DB instance?So before I connect I should creare a same database in DB instance and tell ec2 send data to RDS ever since
3.If not,how the DB instance know the ec2 is down and takeover the data?
EDIT:
(Unsure)Is it that DB instance is just a place to put database.In order to use it,I need to set up database in DB instance,then connect to it by modifying database.yml file(this file tell rails server where the stored data goes).
How Is it possible to tell when the local database stops then at that time switch to DB instance?
There is absolutely no relationship between your EC2 MySQL DB and the RDS DB Instance. So what you are asking for is just not possible.
A better approach I would say is to have only RDS (No need to have MySQL running locally on EC2 instance). RDS takes snapshots regularly. Also, RDS is a managed service, so most of the MySQL administration tasks are handled by AWS and you don't have to worry. And you can rely on RDS snapshots from Backup perspective.

need to connect my same apps with one database

i have 3 servers for three applications on aws ec2 using MySql database,
now each of the application is having amember that is client subscription app,
it connects with sql databse that is created in each instance
so in this way every amamber app is having diffrent database in each server,
now we are working with a device ROKU we need to pass the XML attributes from amember to it
to varify the user so he can watch online streaming tv.
the objective
now i need to make one database that will be connected with each server using amember
so each server access one database .
Options
my options are aws RDS ,dynamoDb
Now can anyone put me in the right direction, for that.
in simple Words
need to connect my multiple apps (same app) with one database
HELLLLP
If you need to connect to a mysql database, DynamoDB is not the answer. It isn't a mysql database.
RDS is a mysql database. It connects like any other mysql database. You haven't mentioned what language[s] you are using, however. Googling "connect to mysql with [language]" should help.
I think it would be best to stick with relational databases such as MySQL.
Amazon RDS is a managed MySQL solution, but you don't have to use it for your needs.
You can use one of your EC2 instances or a new EC2 instance as the central DB and connect all the other servers to it for quires. There are pros and cons for choosing RDS over your own SQL server. If you have any questions there, feel free to edit your question and add them.
EDIT according to comment
In order to connect your application with the local MySQL. Your are probably using a connection string that points to either "localhost" or "127.0.0.1"... That is the IP of your local machine. You will have to change it to the remote IP of the machine where the DB is stored remotely.