☝️Small business or a startup? See if you qualify for our special offer.
+

How to create a long-running report asynchronously?

Answered
Kunal Ashar asked on January 30, 2025

Hello,

We have a scenario in which the backend (database) that gathers the list of fields for the design of the report/pivot, and the part that gathers the actual data itself both take a long time because of the volume of the data and the load on the database.

Is there a way to use Flexmonster "asynchronously", in such a way that Flexmonster can make async requests to the backend API to get the fields, and then asynchronously to get the actual data, instead of waiting synchronously for the data to be retrieved?

 

Thanks,

Regards,

Kunal

5 answers

Public
Maksym Diachenko Maksym Diachenko Flexmonster February 3, 2025

Hello, Kunal!

Thank you for writing to us.

Based on your current data loading process description, you are using a JSON or CSV data source. With these data sources, Flexmonster fetches the entire dataset over the network simultaneously, which can become a huge performance bottleneck while working with large volumes of data.

In such a case, we recommend switching to a server-side data source, specifically Flexmonster Data Server (FDS) or custom data source API. Both approaches rely on our communication protocol, where Flexmonster sends requests to a server responsible for loading, processing, and aggregating data. This helps improve performance in the following ways:

  • Having more resources, the server can perform the necessary computations faster than the client, limited to resources available to the browser
  • Flexmonster only queries the aggregated data required for visualization, decreasing the data transferred via the network.

FDS is an installable, server-side application that implements the custom data source API. Being a ready-to-use solution, switching to this would require minimal development effort. On the other hand, implementing a custom data source API server requires significantly more time, but it grants you complete control over data processing, security, and optimization.

For more information about these and other data source option and their comparison, we recommend reading this article: https://www.flexmonster.com/blog/how-to-choose-the-best-data-source-to-use-with-flexmonster/

Please let us know if one of the suggested options works for you.

Best Regards,
Maksym

Public
Kunal Ashar February 4, 2025

Thank you. The problem I'm facing is slightly different. Let me post the clarifying questions here:

Question 1:

  • What is the best way to make report generation async?

Desired workflow:

  • - User is able to select fields from the Flexmonster Fields modal. These are all reportable fields in system (over 100).
  • - No data is loaded yet.
  • - Once field selection is complete, user will have the ability to apply additional date filters before any data is loaded.
  • - Once Date filters are selected, then the user will click a separate Run button to start report generation.
  • - Report may take longer than a few seconds and so we would want to run asynchronously.
  • - Once async report is complete, return data to Flexmonster.
  • - User would be able to use the Fields modal to update the report. All 100+ fields would be available in the modal (including fields not in returned data set).
  • - User would also be able to update the separate date filter and re-run the report asynchronously.

Question 2:

  • Even if we choose synchronous reporting, we would like to know if we can control the actual report execution so that we can including date filtering before running.

Question 3:

  • Would there be any issues implementing the Flexmonster custom data source API server in .Net Core 2.1?  We mainly need the CubeController.
Public
Maksym Diachenko Maksym Diachenko Flexmonster February 5, 2025

Hello, Kunal!

Thank you for clarifying and explaining your use case.

To achieve the desired workflow with asynchronous data loading, we want to suggest a solution that some of our customers have already implemented. The idea is to create UI controls for users to select fields and filter dates before passing any data to Flexmonster. The scenario would look as follows:

  1. Create custom UI controls for selecting the fields and setting the date filter. You can position and customize these UI controls according to your requirements.
  2. Fetch the data from the server according to which fields were selected and the date filter set.
  3. Feed the received data to Flexmonster.

As a result, the Field List in Flexmonster would contain only the fields selected by the user in a custom UI control. If other dates should be selected or a new field should be added, the custom UI controls should be used, and then a new dataset can be provided to Flexmonster.

Regarding your question about custom API, we believe the above solution is more suitable for your case, making it unnecessary to implement the custom data source API.

Please share your thoughts about the approach we suggested.

Best Regards,
Maksym

Public
Kunal Ashar February 7, 2025

Hi Maksym,

This is Rob, a software engineer who works under Kunal.  Thanks for your response.  It helped our team have good design discussions and we believe we have landed at a simpler approach.

We will reach out if we have any further questions.

Regards,

Rob

Public
Maksym Diachenko Maksym Diachenko Flexmonster February 10, 2025

Hello, Rob!

Thank you for writing to us.
We are glad to hear that you were able to find a solution that works for you.
Feel free to contact us if you need any assistance with implementation.

Best Regards,
Maksym

Please login or Register to Submit Answer