[ 
https://issues.apache.org/jira/browse/CONFIGURATION-180?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12491813
 ] 

Emmanuel Bourg commented on CONFIGURATION-180:
----------------------------------------------

I see several solutions to improve the performances by caching the properties. 
We may either :

1. load the entire configuration in memory. A flush() method would save the 
new/modified properties back to the database, a sync() method would reload the 
properties. That may be nice to reuse the reloading strategies but currently 
they are specific to the file configurations, that will require some 
refactoring.

2. keep in memory the properties read for a certain time. getProperty("foo") 
will hit the database only if foo was read more than 5 minutes ago for example. 
The delay would be adjustable. Setting a property would still hit the database 
directly.

3. same as 2, but the configuration is preloaded once.


The caching should be optional to preserve the current behavior if needed.

> Cache DatabaseConfiguration values for higher performance
> ---------------------------------------------------------
>
>                 Key: CONFIGURATION-180
>                 URL: https://issues.apache.org/jira/browse/CONFIGURATION-180
>             Project: Commons Configuration
>          Issue Type: Improvement
>            Reporter: Stephen Cooper
>         Assigned To: Emmanuel Bourg
>            Priority: Minor
>             Fix For: 1.5
>
>         Attachments: dbpreload.txt, Enhancement33553.checkstyle.patch, 
> Enhancement33553.patch
>
>
> The DatabaseConfiguration class queries each property as it gets the request 
> for each property.  This is 
> nice for ensuring that you're always up to date, but it doesn't give very 
> good performance in enterprise 
> applications, where the database may not be on the same subnet.
> What we need is the ability to hit the database once, get all the keys/values 
> and then serve up 
> "getString" etc. from that cache.
> I'll be opening a separate enhancement to have a generic Reloading Strategy 
> which could then be 
> applied to this caching DatabaseConfiguration approach.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to