Skip to content

Division Cache and Performance

RCX uses an intelligent caching system to optimize division operations and hierarchy lookups, ensuring fast access control validation and efficient user permission enforcement across your system.

RCX maintains a division cache for optimal performance.

Cache Structure:

{
  "division._id": {
    "_id": "division._id",
    "name": "division.name",
    "parent": "division.parent",
    "hierarchy": ["child_id", "self_id", "parent_id"]
  }
}

Cache Refresh Triggers

The division cache automatically updates in response to specific events, ensuring that your system always reflects the latest division configurations and hierarchical relationships.

The division cache updates in response to the following events:

  • Division CRUD operations
  • Service restarts
  • Manual cache clear from Divisions page

Hierarchy Field

The hierarchy field stores a complete lineage path for each division, enabling the system to quickly validate access permissions and organizational relationships without repeated database queries.

The hierarchy field serves several key purposes in division validation:

  • Contains comma-separated division IDs representing full lineage
  • Order: Child → Self → Parent
  • Used for efficient hierarchy-based access control validation