Systems and methods for improving the performance of a data storage and
retrieval system by enabling dynamic switching from one internal data
structure to another in response to detecting conditions indicating that
a switch would improve performance. In one embodiment, a network proxy
implements a cache using a first internal data structure. The caches
objects comprise Web pages, and the cache keys comprise URLs
corresponding to the Web pages. The proxy monitors cache usage and
periodically determines costs associated with usage of the first data
structure and an alternative data structure. If the costs associated with
the alternative data structure are less than the costs associated with
the first data structure, the proxy crates the alternative data
structure, migrates data from the first data structure to the alternative
data structure, begins using the alternative data structure for the
cache, and deletes the first data structure.