Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the difference between Caching and Pooling?

Tags:

What is the difference between Caching and Pooling?

like image 711
Praneel PIDIKITI Avatar asked Feb 23 '11 19:02

Praneel PIDIKITI


People also ask

What is cache pool?

Cache Pools are the logical repositories of cache items. They perform all the common operations on items, such as saving them or looking for them. Cache pools are independent of the actual cache implementation.

What is caching explain?

In computing, a cache is a high-speed data storage layer which stores a subset of data, typically transient in nature, so that future requests for that data are served up faster than is possible by accessing the data's primary storage location.

What is caching & types of caching?

Caching is a mechanism to improve the performance of any type of application. Technically, caching is the process of storing and accessing data from a cache. But wait, what is a cache? A cache is a software or hardware component aimed at storing data so that future requests for the same data can be served faster.


1 Answers

Cache - store frequently used values, typically because the lookup and/or creation is non-trivial. e.g. if a lookup table from a database is frequently used, or values are read from a file on disk, it's more efficient to keep it in memory and refresh it periodically.

A cache only manages object lifetime in the cache, but does not impose semantics on what is held in the cache. A cache also doesn't create the items, but just stores objects.

Pool - term to describe a group of resources that are managed by the pool itself. e.g. (Database) Connection Pool - When a connection is needed it is obtained from the pool, and when finished with is returned to the pool.

The pool itself handles creation and destruction of the pooled objects, and manages how many objects can be created at any one time.

Pools are typically used to reduce overhead and throttle access to resources. You wouldn't want every servlet request opening a new connection to the database. Because then you have a 1:1 relationship between active requests and open connections. The overhead of creating an destroying these connections is wasteful, plus you could easily overwhelm your database. by using a pool, these open connections can be shared. For example 500 active requests might be sharing as little as 5 database connections, depending on how long a typical request needs the connection.

Cache Pool - mostly seems to describe the number of (independent?) cache's that exist. E.g. an asp.net application has 1 cache per Application Domain (cache isn't shared between asp.net applications). Literally a pool of caches, although this term seems to be used rarely.

like image 113
Tom Avatar answered Oct 24 '22 07:10

Tom