Continuously retrieving information from a database to display on a web page

Our team is currently developing a solution that requires a dashboard with basic views and charts that need to be updated every 10 seconds when active. Each user will have the same charts but showing filtered information.

In order to achieve this functionality, I have started exploring push technologies and conducted tests using JSF + PrimeFaces + PrimePush. While this setup successfully refreshes the view, it requires a robust backend structure with scheduled jobs and session management to fetch data from the database at the desired frequency. Additionally, utilizing PrimePush with Atmosphere introduces challenges related to channel management, as each user needs a separate channel for the data feed.

I am seeking feedback on the suitability of this approach and if there are any alternative Java-based solutions that might better suit our dashboard requirements.

Thank you for taking the time to read this and feel free to ask if you need more details.

Answer №1

The rate of occurrence is not particularly high: 10s constitutes a rather lengthy polling interval.

In this scenario, utilizing AJAX to poll from the browser is acceptable. When it comes to the backend, the servlet could retrieve the latest changes from a database.

It may be a straightforward setup, but it should suffice for your needs.

If you encounter performance issues, you might want to consider implementing asynchronous servlets in conjunction with JMS queues. This approach would be suitable if reducing latency is a priority (e.g., aiming for a 500ms response time).

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Django Not Receiving Data from Ajax Request

I am trying to create a basic ajax method that will run once the document is fully loaded. The code I currently have in my JS file is as follows: $(document).ready(function() { $.ajax({ type:'GET', url: '/get_alert&a ...

Performing a PHP Curl request and an ajax query to an ASP.NET page

I am attempting to send an ajax query to an ASP.NET page. Here is the algorithm I am following: 1. There is a form on my webpage; 2. When the user fills in all the fields, they click the submit button; 3. Upon clicking the submit button, JavaScript sends ...

Why am I getting a ClassCastException from java.lang.Long to java.lang.Integer when trying to set the proxy version with an integer in Selenium?

I am attempting to configure a socks proxy for chromedriver in Selenium. The code I am using is quite simple: System.setProperty("webdriver.chrome.driver", "/opt/local/bin/chromedriver"); ChromeOptions options = new ChromeOptions(); Pr ...

Triggering updates from multiple controls in a GridView using ASP.NET

I am faced with a challenge involving a gridview containing numerous checkboxes, sometimes over 40. My goal is to have these checkboxes trigger a .NET function in the code behind upon being clicked. The complication arises from the fact that the checkboxes ...

Encountering an EMFILE error while attempting to include node_modules/ despite having generous limits in

I am facing an issue when I add the node_modules/ folder to my web server directory. An inotify error EMFILE occurs. Despite setting /proc/sys/fs/inotify/max_user_instances /proc/sys/fs/inotify/max_user_watches to values well over 100,000, the problem ...

Unable to fetch Rails response through Ajax

Whenever I make a post request from my phonegap app (using ajax in javascript) to my rails server, the post goes through successfully. However, I do not receive any response from the server which ultimately leads to failure. It's puzzling why I'm ...

Unraveling nested JSON Response in Struts 2 jQuery <sj:select> tag - A step-by-step guide

Currently, I am developing a web application that utilizes Struts2 and its jQuery Plugin. The <sj:select> tag in my code below works perfectly when the JSON response is not nested: <s:url id="remoteurl" namespace="/XYZ" action= ...

What is the best way to obtain the id of a selected row using JavaScript?

I'm attempting to utilize the JavaScript function below to extract a specific cell value from a jqgrid upon clicking. Within the following function, #datagrid refers to the table where the jqgrid is located. $("#datagrid").click(function ...

What is the best method for transferring data from a Facebook application to my server using Ajax?

(Given that FBML and FBJS are no longer supported by Facebook, I am unable to utilize those methods for transmitting data to my server). I have created an IFRAME Facebook application, primarily designed for use on pages. When a page administrator accesse ...

How to efficiently use ResponseEntity for user registration via POST method

Currently, I am in the process of constructing a REST API for my website's backend. One Controller that I have set up is for registering new Users: // CREATE A USER @PostMapping("/register") public ResponseEntity<?> createUser( @Request ...

Having Trouble with $.ajax Function in my Program

After spending three days experimenting with various methods, I'm still unable to successfully use the Javascript ajax command to send form values to a php script. Despite no errors being displayed and the scripts running smoothly, nothing is getting ...

Function exhibiting varying behavior based on the form from which it is called

Currently, I'm utilizing AJAX to execute a server call, and I've noticed that the behavior of my function varies depending on its origin. Below is an excerpt of the code that's causing confusion: <html> <body> <script> ...

Element not found on Canvas with Selenium WebDriver

I have a Vaadin Framework application where I need to interact with a rectangular polygon on the Canvas. Below is the HTML code snippet: <canvas width="1920" height="524" class="ol-unselectable" style="width: 100%; height: 100%;"></canvas> I ...

Locate an original identifier using Selenium WebDriver

In search of a distinctive identifier for the "update profile picture button" on my Facebook account to utilize it in automation testing with Selenium WebDriver and Java. I attempted driver.findElement(By.className("_156p")).click();, but unfortunately, i ...

Having trouble retrieving data item with JQUERY's getJSON method

I am currently using a getJSON request in my code snippet: $.getJSON(url + "&callback=?", { postData: myText }, function(data) { alert('data : ' + data); }); During testing, I have an application running on "localhost:8080" where I ...

Identify and eliminate the shared segment between two strings to remove it

Can anyone offer advice on how to identify and remove common parts from two strings? Here is an example of my code, which doesn't always work as intended: var link = $('.some a').attr('href'); window.location.hash = link.replace( ...

Having trouble connecting the controller variable in AngularJS to the HTML page

I'm struggling with a simple query that doesn't seem to be working for me. When making an Ajax call and retrieving data from the backend, everything seems to be in order. Here's the code snippet: $.ajax({ type: "GET", url: service ...

The dictionary of parameters includes an empty value for the parameter 'imageWidth', which is of a non-nullable type 'System.Int32'

I am facing an issue with a function that executes an ajax call to an ActionResult. It sends a base64 string of an uploaded image along with some additional parameters containing information about the dimensions of the image. The data is sent to the server ...

Tips on adjusting the rotation speed of an Angular Material progress-spinner

For my web project, I have incorporated a material progress spinner. However, I am finding that it rotates at a very slow speed. Is there anyone who knows how to increase the rotation speed of this spinner? ...

Altering the submit button's value following the submission of a form

My goal is to create a form with a submit button that, when clicked, will insert the value of the button into a database and change the text on the button to inserted. If the insertion violates any constraints, then the text on the button should be changed ...