Below are the
differences between the Caching and data
replication:
Caching
:
- Caching is the process by which the frequently accessed or used
data is being temporarily transferred to cache so that it takes
less time to access the data from the main memory as the data is
stored in main memory for all the processes.
- Caching speed to access the data is less as compared to
replication.
- Caching does not backup all the data that is present in the
main memory . Therefore if there is any data loss happened , then
only few files might be recovered and not all.
- There is no scope of accessing the data if the connectivity is
lost among the databases on different servers.
- Cache is build over time gradually and the speed of accessing
the data grows directly as more and more files are being added to
the cache.
- Caching has no space restrictions as larger caches can store
considerable amount of data .
- With Caching the network bandwidth cost will only reduce and
never increase as the data is not accessed until it is actually
required.
Data
replication :
- Replication copy the changes or mirror the changes of the data
from one database to another database over the servers. The
databases are generally present on different servers. It also helps
to achieve the failover capability and load balancing. Once the
data is copied to the other databases then the queries can directed
to the other databases other than the primary database thereby
reducing the network traffic .
- Along with the subsequent accesses , it also increases the
speed of the first data access request.
- Replication does the data backup with double the efficiency ,
so in case of any loss of data the backup is available for the
entire data with no loss of data .
- In case the network connectivity is lost , then still there is
a full access to the data as the main data is being replicated at
different servers.
- Building a new replica from the scratch takes a very long time
and incurs high cost as well .
- Replications take more disk space as all the replicas are of
same size . This becomes a problem for the projects with very large
amount of data.
- Replication copies every change that happens to the data which
overloads the network bandwidth and thereby increasing the
bandwidth cost .