Hi All,

I have noticed that the property handling in registry core is not done
properly. The ResourceDAO interface(which is the data access object for
resources) has only 2 methods which is related to properties and that is to
add properties and remove properties[1]. I have noticed that we call the
add properties method for both resource add and update operations. In other
words, for each add or update operation of a resource, we insert all its
properties again to the database. This behavior is there even if we turn
off resource versioning.

IMO, this is an critical issue and it can lead to unnecessary database
growth. Also note that this causes unnecessary calls to the database too.
To insert a single property, we use 3 queries and because of that 3
database calls happens. This number multiplies by the number of properties
for that resource. If we had 10 properties for a resource, the registry
core will do additional 30 database calls when the resource get
updated. Because of this reason, the REG_PROPERTY and
REG_RESOURCE_PROPERTY tables keep growing.

Please note that this is one of the reasons why we see a performance
degradation when we connect to a remote database and do certain operations
like lifecycle management(since it uses properties to hold certain
information). AFAIK, most of our products use registry properties to store
various information and because of that this is a critical issue that needs
to be fixed.

Thanks,
Janaka

https://wso2.org/jira/browse/REGISTRY-870

[1]
https://svn.wso2.org/repos/wso2/carbon/kernel/trunk/core/org.wso2.carbon.registry.core/src/main/java/org/wso2/carbon/registry/core/dao/ResourceDAO.java

-- 
Janaka Ranabahu
Software Engineer
WSO2 Inc.

Mobile +94 718370861
Email : [email protected]
Blog : janakaranabahu.blogspot.com
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to