What does "Avoid using isolated Aggregates" mean?

Hello everyone. I am trying to review for the Outsystems Professional Traditional Web exam and I came across this topic in the "Performance Best Practices - Queries" documentation. It says "Avoid using isolated Aggregates". Another note below states "Never create an action to execute an Aggregate". It got me thinking. Aren't wrappers executing aggregates? So, wrappers for CRUD operations aren't best practice then? I'm kind of confused. If my assumption is wrong, could you guys give me an example scenario where there's a use of an "isolated Aggregate"? I can't really think of any aside from wrappers. Your answers will help me understand this topic better. Thanks in advance.

Hi Reynald,

When you fetch an aggregate on a screen, the platform knows which fields of the aggregate are used and only fetches those used attributes from the DB. The query in this case is optimized.

However, if you isolate the aggregate in a server action and use that server action in a data action for instance, the platform doesn't know which fields are used, and all attributes are fetched.


This doesn't apply to CRUDs, only Gets (I think that was your confusion).


Hope this helps,

Pedro

I got it. Thanks Pedro Marques !

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.