Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to connect MySql database with Firebase?

Tags:

How to connect MySql database with Firebase. This is for real time data updates and show it on browser. Already created Firebase account and got config code. Now I want connect my existing MySql based database with Firebase.

Please Help

Thanks

like image 715
Nithin Avatar asked Jun 08 '16 07:06

Nithin


2 Answers

This is something that I have been interested in recently as well.

Here is a great article that should answer your question:

https://firebase.googleblog.com/2013/03/where-does-firebase-fit-in-your-app.html

"Pattern 2: Firebase-powered app with server code" can probably provide you with a solution to connect Firebase to your MySQL DB.

What you could do is have your PHP app send updates to your firebase db when ever something update-worthy happens in your MySQL database. If all your clients are then subscribing/watching the changes to your Firebase db, then you have (albeit indirectly) connected your MySQL database with your Firebase db.

Hope this helps.

like image 79
aero Avatar answered Sep 20 '22 14:09

aero


You can store and retrieve Firebase data using REST API. Create the API in the same server as the Mysql database - this will work from any environment that lets you make HTTPS requests.

like image 45
Dev Magician Avatar answered Sep 18 '22 14:09

Dev Magician