Is there a way to find out on the web when changing the db data?

Asked 2 years ago, Updated 2 years ago, 81 views

The database is using mysql.

Is there any way that the web will notice and process when the DB specific value is updated?

database web mysql

2022-09-21 18:52

2 Answers

There is no separate way to know that certain values change in the database.

This can be resolved in the following ways:

It is difficult to notice changes from the database, so when changeor changes the value to the database, it is better to replace it by informing web who needs to know what has changed. And in case you can't immediately notify the change, you need to have a separate way to notify the change later. For example, you should record the change time so that you know when the change was made, or you should temporarily save the change itself to a database or log.

The way changeor notifies web now requires websocket that the server can tell the client, or long polling or comet. Alternatively, you should use the polling (short poll) method, which web constantly urges the server at short intervals.

Note:

[1] For instructions on real-time updates, see http://dev.epiloum.net/790 this document.

[2] Also, please refer to the government's link on the web socket.


2022-09-21 18:52

(It is not an answer that explains that this is a good way, but an answer that means that there is a way to do this. Please choose which method is good depending on the situation.)

https://github.com/awslabs/aws-lambda-rdbms-integration

The above link is an example using rdbms and aws lambda.

We can replace aws Lambda with the web you asked.

Summarize the main contents of the link above.

When content is added (insert) to a particular table

Defines a trigger function to be executed.

The trigger function performs the task of calling the aws lambda function.

As I said above, if you think about replacing Lambda with web,

When the value of db is modified, added, or any other action is taken

Create a trigger function that responds to the action.

This function would do something that tells the web.

In the above answer, Heo Dae-young's answer was that the application team implemented the function of informing the client.

The method I suggested is implemented in db, so when there are multiple applications looking at the same db and each application needs to implement the same function several times

If you implemented it in db, you only need to implement it once...

I don't think it's exactly the way you want it to be,

There's this way, and I'd like to leave it to you for inspiration...


2022-09-21 18:52

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.