I've done research these past 3 days on how to possibly be notified in realtime for mysql. The issue is MySQL doesn't have that feature available so you have to result to other options like:
Now it all sounds nice to have these options but I don't want to move any of my data to another DB. I enjoy using MySQL and want to keep my data there. I have registered users and keep track of comments, likes, posts etc. I use a custom API that I developed with php to communicate from MySQL to the mobile application.
What are my options that will allow me to keep my data in MySQL while also being able to implement a realtime notification feature that communicates with my android application? (if you can recommend maybe software and the process on how to go about it) Thank you in advanced!
Solved! Go to Solution.
Hi @jccolm10. Thanks for being part of the GoDaddy Community! Let me first preface what I'm about to say with an admission that I'm in no way a software developer or database engineer/manager. However, it seems to me like there are probably ways to do what you're trying to do. I did a bit of searching online and found a 3rd party company called Datadog that offers MySQL monitoring with alerts, though I don't know if they send that via mobile app. I also found this post on a 3rd party forum that might help. From what I can tell, this isn't a feature built into.
One thing to note, the above solutions may require higher-level database access than what is available on a shared hosting database. If you use our cPanel or Plesk website hosting, you may not be able to use either of the suggestions above. You might need a VPS or Dedicated Server.
I hope the above helps. If not, there may be others in the Community that have further insights. I know @PL281 and @JHasselbring often participate in discussions about servers, so they may have something to add.
There's nothing that directly integrates with MySQL and PHP isn't really the best software to allow socket connection.
There is a service that I use for my error log/monitor called `pusher.com`.
The way it works is that it has 2 sets of codes, serverside and client side.
The serverside integrates with PHP: PHP receives a request > PHP updates MySQL > on success, PHP sends an update to `pusher.com` via an API > `pusher.com` notifies all clients (browsers/webview)
The clientside integrates with the browser/webview or any clientside that use JS: Once the client finish loading a page/view, it subscribes to `pusher.com` via an API > once `pusher.com` receives an update from your PHP, it will notify the JS > the JS then fires what ever script you want it to fire like console.log(), alert(), toast(), notify() or any custom code.
I think, internally, `pusher.com` uses `socket.io`. If you're familiar with node.js, you can implement your own socket server.