View source | View content page | Page history | Printable version   

Projects:Improve Org Session Cache&action=edit/Specs



The goal of this project is to improve scalability by reducing the memory used per session in Organization cache.


In every operation performed in Openbravo, organization tree structure needs to be checked in order to guarantee correct access rules are applied, so it is cached in memory per session to improve performance.

Currently (3.0PR18Q1), the size of this cache depends on various factors:

In an instance with 600 organizations, a role with access to all of them would consume:


These are the 3 problems that will be addressed in the scope of this project:

Redundant caches

Organization tree is cached in two different structures:

For the 600 organizations case, OrgTree consumes around 200KB per session. This cache should be completely removed, replacing the few uses of it with OrganizationStructureProvider.

Excessive caching

OrganizationStructureProvider caches natural trees and ascendant and descendant trees for every single organization in the tree.

If computation of ascendant and descendant trees is optimized, a single structure caching the whole tree definition could be cached this structure would replace current duplicates for each organization.

Note further improvement could be done if this common tree definition would be cached not per session but per system. The problem with this approach is how and when this cache should be invalidated in case of modifications in the tree structure, because of this complexities it will not be implemented for the moment:

Missing cache

Some attributes of the organization (such as flags to allow transactions on it) are not cached, so they are queried from DB every time they are going to be used. Adding those flags to a common cache per session, will not add a significant overhead in terms of consumed memory, but will reduce the number of queries required to make use of it.

Retrieved from ""

This page has been accessed 554 times. This page was last modified on 21 February 2018, at 16:27. Content is available under Creative Commons Attribution-ShareAlike 2.5 Spain License.