Broadcast the real time MySQL database table data - mysql

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

Related

Questions about Firebase and MySQL in a mobile app

I'm fairly new to programming and I'm studying App development with Ionic and using Laravel as a backend. So far I have created a simple system with sign up and login of users and creation of "events" by the users. I have made the relation between the users and events as the app will need to know which user created an event, and the participants of such event.
Now, I was wondering about adding a messaging system between users and obviously push notifications and stuff and came across Firebase. I've read about it before, but haven't really used it so I'm not quite familiar with it.
My question is, is it possible or even recommended that I use both MySQL and Firebase in my app or should I just stick to one? I've read about Websockets if I stick with Laravel, but on the other hand, Firebase also handles user login and registration in case I want to move to Firebase completely. I'm having some technical questions, such as:
if I'm using both MySQL and Firebase in my app, how would I connect the user that was registered with an ID and a username stored in my MySQL to Firebase, which will need to know which user has sent a message to another one? Can that be done, or recommended?
Should I just stick with just one for my use case (MySQL or Firebase, instead of both)?
I have researched about use cases similar to mine and couldn't find anything, if you guys have come across such situation, could you recommend any materials? It would be much appreciated!
Thanks a lot everyone! I hope my questions were clear, if you need more details, please let me know!
If you decide to use Firebase, it comes with a built-in authentication system so you wouldn't need a MySQL database or your own server.
If you decide to use both anyways (if you have a good reason to do so), you would have to handle all the logic for copying the authenticated user id over to firebase (and validating access) on your own server. If you don't need to do that just keep it simple: Firebase or your own server + MySQL.

How to manage MySQL connections in a microservices architecture

I have the gist of how to connect to a MySQL server, however my dilemma is using passwords. Here are some of the things I am looking at.
Architecture will be 1 core service which as of right now will be set up as a digest authentication service. Note: In the future I will also have it set up for kerberos authentication.
The service will have a schema it will need to be able to access in MySQL. Also the micro services will have their own schemas that they will also need to be able to access.
The database will be localhost initially but will eventually be moved (in production) to a separate server altogether.
Given the requirements above, I cannot give the services users that are restricted to localhost and have no password associated with them (nor would I want that in the event the server was hacked). So how can I have access to the database without using any plain text passwords (I don't want it stored in the code)?
Maybe I am just not understanding something here that could make my life so much easier so again I look towards the wisdom of the many here. Thanks in advance!
Some things that I should maybe mention: I plan on using go-martini as my http router, I'd like to be able to set up OAuth Provider, I will need to manage user sessions and authentication (right now not as important as I'm trying to get the core part of the service setup)
Edit: To clarify some information;
I do not have an AD, kerberos, or any other LDAP service to use and would be hard pressed to set them up at this time in a VM I use for development.
The service should not be dependent on any of those items as SSO is a much later requirement in this project.
Strictly speaking it will be deployed in environments where there are none of those available and this is non-negotiable.
I also am specifically developing the services in Go and the clients in React.
Note: I do not need someone to correct MY question. I would appreciate it if you do not change the context of my question to suite the answer you wish to give me. That is not what StackOverflow is about, it is also quite rude to do that. Thank you.

How to send updates when data changes using MySQL Database?

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

Connecting re-frame app to a Database

I'm having a problem with my re-frame application. I can't figure out how to connect it to a local database on my machine.
In other applications I've written, I've had to add the database specifications (username, password etc) into profiles.clj. Should I create profiles.clj and add the location of my database there? And does this mean I have to update the project.clj as well?
Finally, do the queries to the database, such as GET and POST requests, go in db.cljs.
I apologise if these questions are trivial but after reading the documentation several times I am still a little confused
re-frame is a framework for building client-side web applications. You won't be able to do generic database queries as most databases don't support direct access from a browser.
I'm having a problem with my re-frame application. I can't figure out how to connect it to a local database on my machine.
You probably need to create a middle API tier that accepts REST requests from re-frame, and queries the database, returning JSON back to the client.
Finally, do the queries to the database, such as GET and POST requests, go in db.cljs
Those are probably queries to your API tier? They can live anywhere that you would like.
One thing to clarify: re-frame has an app-db that it uses and refers to. This is a client-side database of local state that lives in your application. It doesn't have a connection to the backend, at least not without you writing more code for it. It sounds like you might be confusing these?

Windows phone 8.1: Need suggestion on what database should I use

For my Windows phone project (it's a Universal app), I have a set up that has a country and a phone number in one of the page. There are about 7 other pages that requests the user for additional information. But for starters, let's just stick with the first one, that asks for the country and the phone number.
I read through a million posts in Stackoverflow and other websites alike, to know what database system is best to implement with the sort of app I am going to be developing, or hoping to develop.
Here're my findings:
Azure SQL: I have an Azure account and I can use the Azure SQL service to store the user-input data directly to the database (when the app goes live), or while in the testing phase. But I got to know that feature isn't really working well as windows phone cannot readily update the data to Azure SQL, on realtime basis. Is it so?
MySQL: I thought I'd create a local MySQL database, for testing purposes, so as I input the data (in the emulator perhaps), the database saves it. I am unsure how I can implement this. I can't find any article I can read that can help me with this. There are with ASP.net, but it isn't what I am going to be using.
SQLite: I know for a fact the data can be stored locally, by using SQLite, but I could like to know if the locally stored data can be later updated on a server-side machine (i'd prefer Azure SQL, but MySQL is also OK with me). If it can be, i wouldn't mind settling with it. If it can't, what can I do?
It all boils down to this: What's the easiest way to store data entered in a textbox (lol, yeah!) to a database (locally or server-side)?
Your efforts to help me will be greatly appreciated!
Thanks!
You can stay on Azure SQL if you have an account.
It works fine and it updates database on the go (sends json as far as I remember), so you shouldn't worry about data being stored in a cloud. Moreover, it is super-easy to use it for your needs (store data from textbox).
Azure SQL will get your bootstrap the fastest for your application. There is no need to deploy MySQL or SQLite and managing your DB. There should not be any concern about updating the DB live from the app.