BookmarkSubscribeRSS Feed

SAS Viya Embraces Redis: A New Cache In Town

Started ‎01-26-2023 by
Modified ‎01-26-2023 by
Views 1,353

Starting with the 2022.10 release, SAS Viya uses Redis to provide a distributed cache technology. Redis Server and the Redis Operator replace Apache Geode and SAS Cache Server. What are these components? And how do they impact SAS Viya architecture?

 

A brief history

 

As the SAS 9 platform evolved into a clustered, multi-tier architecture, some services deployed on the middle-tier and server-tier required a distributed cache to share run-time information between the multiple web application server instances. This was implemented by embedding some java components, provided by the Apache Geode project, into SAS Web Applications, then running an instance of the Cache Locator on each machine. The Cache Locator was used by the applications to locate other members and form a distributed data cache/data store.

 

With the evolution from monolithic SAS 9 applications to SAS Viya 3 stateless micro-services, it became clear that the distributed cache could not be embedded anymore in these services and had to be externalized. The SAS Cache Server was born, still based on the Apache Geode java objects, and the Cache Locator is still there to support it. Together, SAS Cache Locator and SAS Cache Server provide a distributed cache technology to microservices in SAS Viya 3.

 

Finally, with the advent of the cloud-native SAS Viya platform deployed in Kubernetes, these components have been adapted to run in the new environments, but they were not designed to be cloud-native. The new platform exposed some deficiencies, including susceptibility to network instability, the lack of support for new services written in the Go language, and the lack of a Kubernetes operator to manage their lifecycle.  

 

Enter Redis

 

Until the 2022.09 release, SAS Viya includes two Kubernetes statefulsets, one for the SAS Cache Server and one for the SAS Cache Locator, running two pods each to ensure High Availability.

 

Starting with the 2022.10 release, these pods are deployed but not started. Finally, with the 2022.11 release, SAS Cache Server and SAS Cache Locator are completely removed from SAS Viya.

 

Starting with the 2022.10 release, SAS Viya uses Redis to provide a distributed cache technology: Redis Server and the Redis Operator replace Apache Geode and SAS Cache Server.

 

  • SAS Redis server, based on the open-source Redis project, provides a distributed cache to SAS Viya microservices.
  • SAS Redis Operator is a Kubernetes operator, developed by SAS, that manages the life cycle of the SAS Redis Server.

 

The default deployment creates a Redis Cluster with 3 Kubernetes Statefulsets, each one including a controller and a replica node. The cluster is managed by the operator, which runs in a stateless pod.

 

er_1_20230106_01_RedisPods-1024x377.png

Select any image to see a larger version.
Mobile users: To view the images, select the "Full" version at the bottom of the page.

 

Redis pods as seen in Lens

 

The cached data is sharded (distributed according to a hash algorithm) between the 3 controllers, then replicated. In case of a controller failure, after a timeout, the corresponding replica is automatically promoted to controller and the cluster can still service its clients.

 

er_2_20230106_02_RedisCluster.png

 

The current implementation does not support scalability: if you change the number of nodes, it does not reallocate the cached data, and the clients cannot find it anymore. For this reason, the number of controller nodes is currently hard-coded to 3 in the definition of the distributedredisclusters custom resource:

 

$ kubectl get crd distributedredisclusters.redis.kun -o json | jq .spec.versions[].schema.openAPIV3Schema.properties.spec.properties.masterSize
{
  "default": 3,
  "format": "int32",
  "maximum": 3,
  "minimum": 3,
  "type": "integer"
}

 

Although it is possible to scale up the number of replicas, no official performance testing has been conducted so far; the default implementation should be sufficient for most deployments.  

 

Conclusion

 

In this article, we have introduced the new SAS Redis Server and SAS Redis Operator available with SAS Viya 2022.10 and later. For more information about the management of SAS Redis Server and SAS Redis Operator, you can consult the updated SAS Viya Administration: Infrastructure Servers page.

 

Find more articles from SAS Global Enablement and Learning here.

Version history
Last update:
‎01-26-2023 04:24 PM
Updated by:
Contributors

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

Free course: Data Literacy Essentials

Data Literacy is for all, even absolute beginners. Jump on board with this free e-learning  and boost your career prospects.

Get Started

Article Tags