Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

100
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda