What is the difference between Database Hoarding and Caching?? They seem the same to me. I know that hoarding has something to do with the use of the database when the device is disconnected from the server. Doesn't caching help for this? What is the difference?
24 Answers
Caching is more suitable for on demand requests, where you cache data that is needed on cache misses. It will usually be stored in memory and cleared after a while to avoid stale data which does not let you operate in disconnected mode. The other alternative is more suitable for disconnection mode by pre-fetch required data into the local cache and also in some implementation will try to keep it in sync with the remote database. This way you can still operate in disconnected mode but you may see stale data.
You can think of the same semantics in IMDG (In memory data grids) where a remote client can cache the data on demand or pre-fetch the data and have it synchronized with the remote IMDG asynchronously behind the scenes. GigaSpaces XAP provides exactly this capabilities with its in memory data grid, the first on demand caching concept is called Local Cache while the second pre-fetching concept is called Local View where you specify upon creation which type of data should be preloaded and behind the scenes it will be kept synchronized with changes done in the data grid.
Eitan
Hoarding is performed when the connectivity with the server is strong. In this stage the client becomes aggressive and prefetches the data based on the user access patterns. Caching on the other side have nothing to do with connectivity its an operation which gets performed locally on the frequently used data.
A mobile device is not always connected o the server or a network, neither does the device retrieve data from a server or a network fro each computation. Rather, th device caches some specific data, which may be required for future computations, during the interval in which the device is connected to the server or network. Caching, entails saving a copy of selected data or a part of a database from a connected system with a large database. The cached data is hoarded in the mobile device database. Hoarding of the cached data in the database ensures that even when the device is not connected to the network, the data required from the database is available for computing.
Some examples of hoarding are downloaded ringtones, music etc. which can be used offline also.
Hoarding is used when you connect to server and caches are used without any connection. Both work the same way: they store the data which is frequently searched. They store the compressed DB of device for applications.