27
Views
2
Comments
Logic best practices
Discussion

Which of the following strategies is not a recommended best practice for optimizing your logic in OutSystems?

A) Avoid performing queries inside cycles. Try a single and more complex query instead.

B) Avoid complex pre-processing of queries. Try to do some of the work when writing the data in the database instead.

C) Avoid calling multiple Server Actions inside a Client Action. Try to have the necessary server-side logic in one single Action and call it instead.

D) Avoid creating Entities for configuration values. Try to use Site Properties that can be easily changed in the logic instead.

2022-01-05 09-37-24
Faiz Khan

Hi Ranjith, 


The answer is D because while Site Properties can be useful for some simple settings, it's generally better to use Entities for configuration values, especially when you need version control, flexibility, scalability, or need to manage updates without redeploying the application. Entities offer more structured, secure, and scalable management of configuration data. 

Regards 

Faiz

2024-03-05 10-18-49
RAHUL KUMAR

Hi @Ranjith ,

From the above options, the Correct option is D due to following reasons :-

1. Performance :- Site Properties are loaded at the application start and remain in memory throughout the application’s lifecycle. This can affect performance whereas Entities allow you to store data efficiently in the database and query it only when needed, which helps in improving memory usage and performance, especially with larger configurations.

2. Flexibility :- Site Properties are designed to store a small amount of static or rarely changed data. Since, Site Properties are loaded into memory, they can become inefficient for managing multiple or dynamic configurations. Entities, on the other hand, are part of the database. They allow you to store, query, and manage any amount of configuration data, whether it’s static or dynamic.

Therefore, Site Properties are generally meant for application-wide settings that don't change frequently, and they are loaded into memory at runtime. For more complex or frequently changing configurations, using Entities is often a better practice, as it allows for easier scalability, querying, and management. 


Regards,

Rahul Kumar

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