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

117
Views
is it safe to use ajax call every 5 second to check for new inserted database row

im working on a project using asp.net mvc. and im trying to read data from sql server every 5 second and update the user with some feedback.

what I've done till now is using ajax call combined with set timeout. so every 5 second use ajax call to check if there any new data as shown below.

( the URL is just an example)

  function ajaxRequest() {
  $.ajax({
    url: "https://jsonplaceholder.typicode.com/photos",
    success: function (result) {

      console.log(result);
 
    },
    complete: function (data) {},
  }).then(function () {

    setTimeout(ajaxRequest, 5000);
  });
}

my question is, is there any down side for using set timeout or set interval with ajax like this? or if there is any better solution for my problem.

worth to mention that the project will be used by at max 4 users at the same time. so I don't think over-loading the server with request will be a problem.

over 4 years ago · Santiago Trujillo
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!