-
Notifications
You must be signed in to change notification settings - Fork 185
Description
Currently, the MeshModel summary UI (components and relationships counts) is populated by fetching every single entity from the database into memory. In server/internal/graphql/resolver/meshmodel.go, we call GetEntities(), which retrieves thousands of definitions just to perform a GROUP BY and COUNT(DISTINCT ...) operation in memory.
As the MeshModel registry grows, this approach leads to:
- High Memory Usage
- UI Latency: Subscriptions for registry updates are slowed down by the
$O(N)$ processing time. - redundant bandwidth consumed
possible changes
Move the aggregation logic from the GraphQL resolver into the Registry Manager (Meshkit). Instead of fetching full entities, the data layer should perform the grouping and counting.
concerns
right now the existing entity.Filter interface would break or we end up creating brittle.
possible change
Capability Interface (Type Assertion): Introduce a SummaryProvider interface. If a filter (like ComponentFilter) implements it, the Registry Manager uses the optimized path.
Output
Reduce the memory footprint and response time of the /meshmodel/summary endpoint/subscription to near-constant time, regardless of the number of registered entities.