Projects:View Generation Improved Scalability/Specs
Current Issues
Currently (PR18Q4) generating views has two major problems:
- It is slow (it can take few seconds)
- It consumes too much memory
Generated views are cached in the browser which reduces the severity of the problem. But in situations such as code upgrades, this cache is invalidated so potentially many clients can start requesting views simultaneously.
The causes are:
- Many queries for AD elements are performed using DAL, this causes having many in memory Hibernate entities.
- Repeated queries to get Grid configuration properties, even there is no Grid Configuration defined for a Window, every field is queried to check so.
Proposed solution
Since 17Q2 ADCS is Application Scoped, it caches Application Dictionary definition. Making use of it would reduce the number of queries to AD to generate views as well as it would make a better memory use.
In order to reduce queries to Grid Configuration, we should make use of Hibernate 1st level cache, so all required information for grid configuration is requested from the database all at once rather than getting it field by field. Note that this information cannot be currently cached as it is expected to be modifiable without requiring Tomcat to be restarted.
Concerns
Areas to take into account:
- New entities might be required to be cached in ADCS. This needs to be done carefully not to increase it noticeably.
- ADCS initialization needs to be revisited in order to prevent possible LazyInitializationExceptions due to clashes between FIC and View uses