ATG Repository Best Practices/Useful Tips While Creating Repository

Never user one primary table in more than one item descriptor,this can create problem in Item caching.If table get updated by one Item, other Item will not get invalidate.

Try to avoid derived properties, it can adversely affect system performance

Don’t use derived and transient property as part of RQL and ATG Query

Use Lazy loading in repository item to improve performance.

Most of time developers traverse from parent to child repository, you may need to evaluate. Use RQL instead of looping through repository item which can affect performance.

Maximize use of Query Builder to build query in case you need to build query dynamically rather than executing filtering at server end.

Use enumerator instated of flag until it is required.

You can also turn on debug messages by including a loggingDebug attribute tag in the repository definition for that item descriptor or property.

Use ATG cache pre-loading, this will achieve better performance disadvantage of this would be slower startups. You can configure the SQL repository to automatically save and restore its caches, or you can load the caches manually by using the startSQLRepository script with an appropriate XML file. It is probably a good practice to put cache-loading tags in a separate XML file with the same name as your repository definition file and rely on XML file combination to invoke the queries.

All properties referred to in the filterQuery or rqlFilterString should reside in the primary table for the item descriptor. This will provide good result in terms of performance; otherwise joins will be required to get result which can adversely affect performance.

Always add NULL check with Comparison and pattern-match repository queries,as it do not return items where the property queried is null. If you want null items to return you have explicitly add null constrain eg :(amount != 10) OR (amount IS NULL).

Used Named query, this can be reuse you don't have to build a new query object each time.

Define column-name  attribute explicitly even when identical to property name.

Set required atrribute to true for properties linked to non nullable columns.


See Repository Cache hitRatio,missRatio and usedRatio

2 comments:

Unknown said...

Very Nice tips

Sebastian said...

Thanks for the feedback !!

Post a Comment

Related Posts Plugin for WordPress, Blogger...