need to connect my same apps with one database - mysql

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.

Related

Why is my MySQL Database on AWS not accessible?

I cannot reach my MySQL Database instance I created on AWS.
What I tried was to set the public access of the Database to "Publicly accessible" here:
Also I tried to set Inbound/Outbound rules for the MySQL port here:
Honestly I think using "All" ports would include 3306 too. Anyways, I tried it this way because yet it didn't work. I cannot connect to the database via MySQL Workbench, nor can I use a ping request on the given endpoint.
I would be glad if someone here has an idea what I could try else.
This will not work if you have deployed it in a private subnet which has no internet access.
Another possibility is that there is ACLs that is stopping the traffic. Security group only touch the RDS instance, the ACLs control traffic in the entire subnet.
Here is a dev AWS tutorial that creates a web application that stores data in MySQL running on the cloud. It will show you how to setup the database and the inbound rules. Once you do, you can store data or query data from MySQL. Likewise, you can use MySQL Workbench to interact with MySQL on the cloud.
AWS RDS Tutorial

How to connect to the centralized MySQL database from my django website?

Lets say I have two systems that will runs a Django server and one system that will be a centralised database that will only contain database application running on this machine. How can I have two machines connect to same database i.e Read/Write from/to database? What software needs to be running on my MySQL database side so it can get the data from the server and return the data from the database in case of read query ?
The question is how can two server make connection to a centralized database to read/write from it? What code/technology should be running on the database server to send/receive data?
If there are to systems that are solely dedicated as a server and one as a database then how can I make a connection from my two server machine to the centralized database. Which technologies can help me in achieving this? What code should be run on the third machine and how the other two server makes connection to this database?
I fail to understand why you need extra softwares/technology for this.. If all you want to do is make both your django servers access the shared database kn the third server, just point both your django servers to the server running your MySQL.. it should do the job..

Connecting Symfony website to Amazon relational database

I am working on a symfony website and I want to connect it to a remote RDS on amazon on which i will be running some Select queries to fetch some data every time page refreshes.
Is there an easy way to do so? I was reading something about doctrine but I didn't get it how to get it to use a remote database. Is it possible to do without using doctrine?
Amazon RDS is a meta-layer to manage the database server itself. I assume you want to create a database, e.g. in MySQL, on Amazon RDS and use this database with Symfony and Doctrine.
If this is true, it is very simple: In your app/config/parameters.yml file, you have various database_* parameters. Just set the database_host to the IP address or domain of your DB server as provided by Amazon, set the correct user/password/port, and you're ready to go.

How does one see what data is stored in the RDS database?

Running our app on Amazon RDS. How does one review / inspect data in the database? For example, how can I get a list of articles?
My app is running on Ruby on Rails and on Heroku. One method I thought of, is by running the Heroku console command.
Is there a better way to see what data is stored in the RDS database?
I use MySQL Workbench to view data, run queries, and so on. It connects right up to the Amazon RDS MySQL instance using the regular MySQL settings.
Updated:
Be sure to add the ip address of the computer for which you're connecting to the RDS instance to the access list in RDS. IIRC, by default RDS instances will only accept connections from within AWS.
I was using SequelPro but they don't support ssl. Amazon RDS says something to the effect of having to use SSH to connect your EC2 to your RDS.
This is essentially what was done in the following tutorial which uses MySQL Workbench: http://thoughtsandideas.wordpress.com/2012/05/17/monitoring-and-managing-amazon-rds-databases-using-mysql-workbench/
I had also been using SequelPro before but this tutorial is very clear and I was up and running on MySQL Workbench in just a few minutes.

How to 'switch' from MySQL to Amazon RDS with minimal application impact?

Amazon officially states: "Amazon RDS gives you access to the full capabilities of a familiar MySQL database. This means the code, applications, and tools you already use today with your existing MySQL databases work seamlessly with Amazon RDS."
I don't get this. Amazon RDS is accessible via web services and there a client libraries (like the one for .Net).
So if I have an existing .Net application that uses a DAL which in turn queries MySQL, how can I make the same DAL talk to the Amazon RDS (via the web services). Or am I missing something here?
Amazon RDS is pure MySQL, accessible by your app the same way as any other MySQL database; the web services interface to RDS is purely for creation, deletion, and modification of the DB instances, not the DB data. From their FAQ:
Q: How do I access my running DB
Instance?
Once your DB Instance is available,
you can retrieve its
endpoint via the DescribeDBInstance
API. Using this endpoint you can
construct the connection string
required to connect directly with your
DB Instance using your favorite
database tool or programming language.
In order to allow network requests to
your running DB Instance, you will
need to authorize access. For a
detailed explanation of how to
construct your connection string and
get started, please refer to our
Getting Started Guide.
This is the part of the Getting Started Guide you need -- it explains how to get the hostname of your new instance so you can connect to it, authorize the instance for access from the client, and then connect using the MySQL command-line client (as an example):
$ rds-describe-db-instances --headers
$ rds-authorize-db-security-group-ingress default --cidr-ip 192.0.2.0/30 --headers
$ mysql -h myinstance.crwjauxgijdf.us-east-1.rds.amazonaws.com -P 3306 -u mymasteruser -p
Amazon RDS is just a normal server with normal MySQL access. There's only the webservice that handles instance creation etc., but everything mysql related is still the same.