On Tue, Sep 16, 2014 at 11:28 AM, Pulasthi Supun <pulas...@wso2.com> wrote:
> Hi Azeez, > > Yes that can be done, that would reduce the number of DB calls further. > We can simply keep an entry for each RXT type that will keep a parity bit > as a value. Once a update is done the listener can query the exact RXT > type that was changed and only load that value. > One more thing, we need to consider a cluster scenario as well right. If we update an RXT from node-1, then node-2 should also invalidate the cache and look into the DB. > > Regards, > Pulasthi > > On Tue, Sep 16, 2014 at 11:04 AM, Afkham Azeez <az...@wso2.com> wrote: > >> For this type of problem, caching coupled with loading only the changed >> parts is the way to go. >> >> On Tue, Sep 16, 2014 at 10:53 AM, Pulasthi Supun <pulas...@wso2.com> >> wrote: >> >>> Hi All, >>> >>> Currently when working with RXT's each time the loadGovernanceArtifacts >>> method is called it in turn will call the DB to load the RXT's, this is >>> to load any changes done to the RXT's . This a major performance hit >>> especially in APIM since when loadGovernanceArtifacts is called >>> multiple times a large number of DB calls are executed. After looking into >>> this came up with the following solution to reduce the number of database >>> calls. >>> >>> We currently load all the artifact configurations to a map that keeps >>> all the artifact configurations against the tenant id. If we can find out >>> when the artifact configurations are updated we can limit the number of >>> times the database is queried by loading the configurations only when there >>> has been a change. To track this we will keep a small distributed cache >>> which will keep a entry for each tenant and will act as parity bit and >>> add a listener for this cache for cache entry update. The lister will >>> then load the changes into the map that keeps the artifact >>> configurations. This way will remove the need to query database every time. >>> WDYT? >>> >>> >>> Regards, >>> Pulasthi >>> >>> -- >>> -- >>> Pulasthi Supun >>> Software Engineer; WSO2 Inc.; http://wso2.com, >>> Email: pulas...@wso2.com >>> Mobile: +94 (71) 9258281 >>> Blog : http://pulasthisupun.blogspot.com/ >>> Git hub profile: https://github.com/pulasthi >>> >> >> >> >> -- >> *Afkham Azeez* >> Director of Architecture; WSO2, Inc.; http://wso2.com >> Member; Apache Software Foundation; http://www.apache.org/ >> * <http://www.apache.org/>* >> *email: **az...@wso2.com* <az...@wso2.com> >> * cell: +94 77 3320919 <%2B94%2077%203320919>blog: * >> *http://blog.afkham.org* <http://blog.afkham.org> >> *twitter: **http://twitter.com/afkham_azeez* >> <http://twitter.com/afkham_azeez> >> *linked-in: **http://lk.linkedin.com/in/afkhamazeez >> <http://lk.linkedin.com/in/afkhamazeez>* >> >> *Lean . Enterprise . Middleware* >> > > > > -- > -- > Pulasthi Supun > Software Engineer; WSO2 Inc.; http://wso2.com, > Email: pulas...@wso2.com > Mobile: +94 (71) 9258281 > Blog : http://pulasthisupun.blogspot.com/ > Git hub profile: https://github.com/pulasthi > -- Thanks, Shariq Senior Software Engineer
_______________________________________________ Architecture mailing list Architecture@wso2.org https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture