+1

People often forget that cache memory is hundreds or thousands time faster that disk access or database references.
Even with the overhead of distributed cache management.
Any extra code required executes at lightspeed rather than rotational speed or even SSD speed.
It is also easier to scale CPU than database IO.

Removing this sort of decision from application developers to framework coders and database administrators is generally a good idea.

Using a standard caching system such as ehcache http://ehcache.org/ is probably the best way to go since it brings a lot of technology to the table and will add a smaller technology TCO to the project even if a custom cache MIGHT give slightly better performance in some cases.

Ron

On 18/03/2015 10:01 AM, Adrian Crum wrote:
On 3/18/2015 1:46 PM, Jacopo Cappellato wrote:
On Mar 18, 2015, at 2:35 PM, Adrian Crum <[email protected]> wrote:

I would be interested in seeing a use case for that.

This is just an example I could think of (there may be other better examples but I am in a rush and I can't concentrate):

Client code A selects a bunch of records from TableFoo in order to update them; cache is disabled to prevent the creation of cache entries that would be expired after a few milliseconds.

Delegator makes a database call to get the bunch of records.

Client code B selects a bunch of records from TableFoo in order to format a list in a web page; cache is enabled in order to hit the cache after the first visit to the page.

Delegator makes a database call to get the bunch of records.

If client code A used the cache, then client code B would not have to make a database call (or the reverse).

The problem with your use case is, a developer is trying to determine the best caching strategy, and that is not something you can decide at design time. Instead, that is a decision that needs to be made during staging - where you can measure the real-world effects of concurrent processes.

Adrian Crum
Sandglass Software
www.sandglass-software.com



--
Ron Wheeler
President
Artifact Software Inc
email: [email protected]
skype: ronaldmwheeler
phone: 866-970-2435, ext 102

Reply via email to