Synchronoss’s status as global leader and innovator in cloud, messaging, and digital platforms and products requires us to ensure data is accurate and rapidly available where and when it is requested. One method that enables immediate access to data is caching. A cache is a subset of data positioned with better locality and I/O characteristics (flash or RAM memory storage) to ensure quicker access to the data in the future. Distributed caching in a cloud environment is analogous to the use of memory on traditional computers. Data is persisted to disk for long term storage but made available by moving it to memory as needed. A distributed environment introduces additional complexities and an array of design considerations. Synchronoss’s expertise in this area alleviates a customer’s need to deal with such complexities and ensures the end user gets the right data, when they want it.

What is a Distributed Cache?
A distributed cache service is deployed in a clustered environment. A cluster runs on several different machines. The subset of the cluster that runs on a given machine is referred to as a node.

caching diagram

 

A number of open source projects can be used for caching. These include Ehcache, Hazelcast, Ignite, Infinispan, Memcached and Redis among others. Caching systems are valuable additions to distributed systems, but they must be implemented using disciplined practices that ensures data is accurate and readily available. Choosing appropriate data solutions for specific product use cases necessitates understanding a few computer science concepts.

CAP Theorem

The CAP theorem (coined by computer scientist Eric Brewer) describes what guarantees regarding consistency, availability and partition tolerance can be made about a given distributed cluster. Consistency guarantees the system appears to be maintaining a single up-to-date copy of the data up to the point of the last acknowledged write. It doesn’t matter which node provides access to the data. It always “looks” the same. Availability indicates that a system will always respond and provide the data requested. Such a system won’t fail to respond or respond with a message that it is too busy to provide the data. Partition tolerance ensures the system continues to operate despite communication issues between nodes. Distributed persistence systems including caches can guarantee no more than two of these three properties at any given time and others even trade off 100% guarantees on ANY of the CAP properties for speed.

Cache Misses

There’s a special property of caching systems that allow us additional freedom to reduce the strictness of CAP theorem decisions. Cache misses occur when data is not available in the fast cache and must be read from the original underlying storage. A cache miss can be the result of first access, aging out, replication or temporary unavailability. Caching use cases must be carefully identified to ensure that periodic cache misses are accounted for in the overall performance profile and still provide a large net advantage.

Comparison to ACID Properties in Traditional Databases

The usage of CAP theorem properties highlights the different needs and tradeoffs in modern distributed caching systems vs traditional relational databases in a non-distributed environment. Many traditional databases instead offer ACID transaction compliance: atomicity, consistency, isolation, and durability which provide different guarantees and tradeoffs compared to distributed persistence stores like caches. A transaction can be one or more statements or data operations. Atomicity guarantees reflect that all operations in a transaction succeed or fail completely as a unit. Consistency is used in a slightly different manner here than in CAP and refers to preventing any database state that violates data integrity rules defined in the database after applying a transaction (constraints, triggers, etc). Isolation allows concurrent data access to provide the same consistent values returned as if the access were taking place one a time sequentially. Durability guarantees that once a transaction is acknowledged it will remain even in case of full system power failure and restart. In other words, it’s been recorded in some area of hard drive storage or other non-volatile memory.

While ACID properties provide great simplicity and expectations for data access, they come at a cost when data needs to be written and read from multiple nodes to achieve greater scale, reduce global latency, and/or increase resiliency compared to the risk of a single giant machine becoming unavailable so the different concept of CAP emerged as a useful standard to be applied instead. It should be noted that even traditional databases may allow relaxing various aspects of ACID properties in exchange for performance, but the guarantees are available if desired.

The Advantages of Distributed Caches

Distributed caches provide blazingly fast access to data when it is needed. A properly designed cache effectively puts the essential data at the fingertips of those who need it most, saving time otherwise spent waiting for slow access to primary data storage. Distributed caches can be positioned at specific geographical locations for additional performance boosts. Distributed caches can be deployed with fault tolerance and resilience in mind, ensuring no disruption of service despite a node becoming within a cluster (due to hardware or other failure).

What it means to our Customers
Synchronoss uses distributed caches in a variety of scenarios. These include temporary storage in a multi-stage pipeline, managing user session data in web applications, and processing related to event notifications. Customers and users enjoy immediate access to accurate data without thought to the design and operation of such a system. Our years of experience implementing complex systems leveraging distributed caching have taught us many valuable lessons which are not obvious from the outside. With 5G rolling out, caching for edge servers will become an even more important topic for ensuring data consistency and availability.

Our projects currently in development continue to advance our capabilities in this area of technology which will ensure the best-in-class services to our customers for years to come.