Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

99
Views
How to update React component on data change event from FastAPI server

Brief of technology used - ReactJS for UI, python Server for API(FastAPI), and SQL Server as database. Here FastAPI uses pyodbc module to connect to the SQL Server database by the creation of a pool. Now the main aim is to update the React component upon changes in the database table.

The current approach: there is an API /api/get which fetches the current state of the database table. The React UI continuously polls this API to get new updates from the database on a fixed interval.

Is there any better approach to receive updates from the database in a more efficient manner?

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

TL;DR

Yes, use websockets.

Every time your UI checks for updates, it creates a new HTTP request. In the long run this will become costly, especially for frequent polls.

An alternative is to use websockets, which establish the connection once and then allow to communicate bidirectionally with the server (in this case, the fastAPI server).

See the docs for more information

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!