How to send updates when data changes using MySQL Database? - mysql

Alright I know you might find this as a silly question, but I'd like to ask you if there's a way to have a listener to MySQL like Firebase can do?
"...Firebase only sends updates to our app when data changes." - from learnhowtoprogram article
To make my question clear, I'm using nodejs, express & socket.io and I really wanted to make a simple web app which will automatically update its data once the database(MySQL) changes.
I've made a prototype using socket.io which listens to the client and emit new data from MySQL and vice versa. Yes, it works but in the long run it's horrible.
I hope you could help me with the concepts.
Thanks!

yes you can do that if you are using nodejs and socket
try this lib : mysql-events

Related

how get table data and post data for Navistion Database in phoneGap

We are very struggled about getting and posting table data for Navistion Database.We need getting data for Navistion DB to our local(sqlLit) DataBase and posting data SqlLit Db to Navistion DB.In PHoneGap
We are goggled.But no luck.So Please give any documentation and link .Please help me.
PhoneGap/Cordova can work with other databases when you use middleware on your server to respond to it. So for example, your server (with the Navistion DB) could use PHP or ColdFusion to respond to Ajax requests from your app. It would handle taking the request, querying the db, and converting the response to JSON. There is no documentation link for this as it is too abstract of a question really.
Agree with Raymond - the question is too general to give any kind of recommendation. Maybe if you could elaborate it a bit - at least outline the task you need to solve, it would be easier to suggest something.
Anyway, I presume, you don't want to insert data into the Navision DB directly, but need an interface to Nav functionality. My first idea would be to look at Web services. Some documentation is available on msdn: Web services in Nav. You can expose Nav objects (Codeunits, Pages and Queries) through a web service and call it from PhoneGap.

Broadcast the real time MySQL database table data

I need to broadcast the real time database table to my web application (Asp.net).
I know I can implement it using SignalR and SqlDepedency. But the issue is my database is MySQL. I have done lot of research on how to implement it using MySQL. But didn't find anything useful.
Please guide me if there is something I can try with MySQL to achieve this ?
Thanks.
You should avoid SqlDep. anyway. I always recommend publishing database changes on a service bus and let signalr pick it up. This way you can fire state changes anyware in your domain and signalr can pick it up
Check this library out to abstract signalr from your backend bus (I'm the author)
https://github.com/AndersMalmgren/SignalR.EventAggregatorProxy/wiki

Trigger node.js when changes made in apache mysql

I'm building a simple commenting system using node and i need to configure this in a PHP project running in Apache server. So, i need to trigger node.js when some changes made in MySQL database table present in the Apache server. So, i need to know whether it is possible to do this in a Apache server? If so, then how to do that? Any idea or suggestions on this are greatly welcome. Please help...
I guess there are few options you could take, but I don't think you can get some sort of triggered action from within MySQL or Apache. IMHO, you these are the approaches you can take:
you can expose a HTTP API from node and every time you need to notify the node app, you could simply insert the data into MySQL using PHP and then issue a simple GET request to trigger node.
You could use some sort of queuing system (rabbitmq, redis, etc.) to manage the messages to and from the two application, hence orchestrating the flow of the data between the two apps (and later the db).
you could poll the database from node and check for new rows to be available. This is fairly inefficient and quite tricky, but it sounds more close to what you want.

Real-time update to NodeJS(MVC, Express), Mysql and Socket.io application

I'm trying to create a real time web application with NodeJS with an MVC layout using the Express framework and MySQL as my back end data store.
The problem that I've run into is that I can't find any good examples or tutorials on how to use Socket.io (or any other web socket platform to pass information in real time from the database to the web application. The specific problem is getting any new update to MySQL on a specific table to pass that information to, so that if new information is added to the database by a second client connection it will update on the first client connection as soon as the information is added.
Does anyone have any ideas on how to get socket.io(or another websocket connection protocol) and mysql to work together to achieve this? Any code example's or pointing me to some websites that have documentation on this topic would be appreciated.
Thank you!

How to have Android App communicate with external MySQL db

I am really confused on how to get data in and out of an android app from the internet.
I imagined that I would store information in the mysql db on the server I already have set up. But from what I have read, I would need some type of in-between web service to make queries with data sent from the app.
Can anybody toss me some tips on how to get something like this started.
Or, if you know of a better way, let me know about it.
This question has been asked several times, for example here: How to get from a MySql server to an Android app?.
Bottom line - you don't connect directly. You have something on your server (like RESTful) that you connect with via HTTP.
Try this method out. I will be using this method for the current project i am working on.
You basically create a php script on a server and use http posts to send the data to the script, read the tutorial linked below for better explanation.
mysql/android tutorial