Improve the loading time to acces data from apps
Some screens require combining a significant amount of information, resulting in loading times of up to 8.4 seconds. To address this, a service is proposed to expose pre-existing database views, shifting the responsibility of data combination to the database and improving availability and response time. The proposed architecture would be as follows:
The Read View Mediator Service has the function of listing and exposing all the views of the database, as well as providing an access point to query those views. Additionally, it allows receiving filtering parameters that will be used as conditions in the query. An example of the request body would be as follows:
Where "view" would be the name of the view, unique in the database. The "params" would essentially be the conditions for the WHERE clause in SQL (one option to implement this logic would be JOOQ). It is worth noting that one of the important factors in this query is the absence of pagination and recycling of the body, which ensures optimal performance when querying the views. The IT team at CIAT conducted a test with an order of 300 items, evaluating the loading times for the most complex view in the viability application. Here are the results obtained: