AWS API REST connected to external MySQL DB - mysql

I made an API REST with Spring boot, connected to an existing MySQL database. This database is not hosted on my local.
The API works fine on my local but I want to deploy it on AWS.
Is it possible to use this remote MySQL database or do I need to use a new one hosted on AWS?
If it is possible, can you guys link any tutorial or documentation? I can't find anything related to this particular issue.
Thank you!

yes, AWS does not limit you to using only their RDS (Relational Database Services) offerings. Configuration of the DB will be the same (or similar if you want to use other instance than one used for your local development) as for your local environment.

Application hosted in aws can be connected to both cloud db and on-perm dB.only thing we need to check is security groups configured in ec2 along with other DB configurations.

Related

Deploy my Flask app to Heroku using my own MySQL server

I have a project with a Flask backend and Vue frontend. I want to deploy it to Heroku but using my own MySQL database from my own MySQL server, without using Heroku's dynos.
Is this possible?
That depends what you mean by
my own MySQL database from my own MySQL server, without using Heroku's dynos
If your MySQL server is accessible from the Internet, sure. Just point your application at it.
(Note that using one of Heroku's database addons does not mean using dynos. These services run as hosted services on the cloud, not on your dynos. JawsDB and ClearDB are both options and both have free tiers.)
If you're talking about something running inside a firewall, e.g. on your laptop, then this won't be possible without doing a bunch of network stuff. It's possible but I strongly urge you not to do this. It's easy to create security issues.

What after connecting AWS database and MYSQL WorkBench?

I need proper explanation and steps to connect to an RDS database from my AWS Elastic BeanStalk Project. I have already created a RDS instance on AWS and successfully connected to it from MYSQL Workbench. After that, I have also connected it to my Elastic BeanStalk project. But still my java based website project cannot fetch data from it. Why ????
This use case is documented here:
https://github.com/awsdocs/aws-doc-sdk-examples/tree/master/javav2/usecases/Creating_rds_item_tracker
This tutorial steps you through creating a Java Spring app that is deployed to AWS Elastic Beanstalk and queries data from an RDS instance.
Please check if you can access your RDS instance from your elastic beanstalk environment when you set the RDS instance to public. If you can you have not configured your security groups to allow connections from your EB environments towards your rds instance.
Note: don't forget to set it to private again after you're done with testing.

Migrating MySQL database from local server to Heroku

I have made a MySQL database on my local server.
I want to port this to Heroku. Would there be any way to do this without using ClearDB? ClearDB asks for account verification, credit card details etc. which I do not want to give. The rest of the application is hosted on Heroku, so I just need to migrate the database.
Would this be possible?
You have at least three options:
There are other Heroku addons that provide MySQL databases. I'm not sure if any of them let you get started without a credit card.
You could use a MySQL provider that's not explicitly supported by Heroku and point your application to it manually.
You could update your application to use PostgreSQL instead of MySQL and use Heroku's own Postgres service.

How to connect from Flexible Environment to Second Generation Cloud SQL instance?

I have deployed my web server which requires a MySQL database for storage. I've created a Second Generation MySQL instance with one failover replica but I am not sure how I can connect to those.
I am not sure how to configure these instances and what I have to consider here e.g. region/zone. Flexible Environment appears to be unavailable in Europe unfortunately - at the moment at least - so I guess I'll have to place the SQL instances in the US too.
Will those instances have to be in the same local network or can they communicate over regions? Will I even be able to control this or will all this be decided by Google Cloud?
Could anybody who has done this before give me a few details about what to do here?
For best performance, you should place your App Engine instances in the same region.
For information on how to connect from your application to the Cloud SQL MySQL instance see the following documentation: https://cloud.google.com/sql/docs/dev-access#gaev2-csqlv2
The short summary is that you have to modify your app.yaml file to list the Cloud SQL instances you will be connecting to. Once that's done, a local socket will appear inside the App Engine VM that will allow you to connect to your Cloud SQL instance.

How do I sync 2 MySQL databases?

I written a program to work with a MySQL database that powers my website and I have recently bought some reseller hosting however the hosting company has restricted external access on the shared server, so I was going to setup an external mySQL database on another server that can be accessed remotely, however to do this I need a PHP file on my reseller server that can connect to the local database and the remote database and sync them on request from the application via a url.
Does anyone know the best method achieve this?
Try using SQLyog's Database synchronization tool