Reputation: 381
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
Upvotes: 26
Views: 87153
Reputation: 55
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.
Upvotes: 2
Reputation: 1724
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.
Upvotes: 12