0

I have an angular app that queries a Mysql table an then show the records in the page for maintenance. I wanted to automatically update the page whenever the mysql table changes.

One way that i can think of is to poll the db at a certain interval but this seems inefficient. Another way is to publish a topic to aws sns everytime there is an update on the table and then my app can subscribe to the topic so it can trigger the api to retrieve the records from the table from my app.

I was thinking if there is a simpler way of implementing this feature.

leo c
  • 663
  • 3
  • 8
  • 19

1 Answers1

0

Polling would work but its not really a modern way of doing this type of operation. Pushing updates to your angular app from your backend is a better experience. You can do this using websockets to push messages when your database is updated. Your implementation will depend on what your backed language is written in. But here are some links I found to get you started:

Community
  • 1
  • 1
George Whitaker
  • 1,588
  • 13
  • 15