<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/valkey-reducing-application-latency-and-lowering-cloud-bill-by-setting-up-your-client-library-svznp0ys9" -->

---
title: Valkey · Reducing application latency and lowering Cloud...
description: AZ affinity routing in Valkey GLIDE (the official multi-language client for Java, Python, and Node.js) lets applications route read requests to replicas in the...
canonical: https://daily.dev/posts/valkey-reducing-application-latency-and-lowering-cloud-bill-by-setting-up-your-client-library-svznp0ys9
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Valkey · Reducing application latency and lowering Cloud bill by setting up your client library | daily.dev
og:description: AZ affinity routing in Valkey GLIDE (the official multi-language client for Java, Python, and Node.js) lets applications route read requests to replicas in the...
og:url: https://daily.dev/posts/valkey-reducing-application-latency-and-lowering-cloud-bill-by-setting-up-your-client-library-svznp0ys9
og:image: https://api.daily.dev/og/posts/SVznp0YS9.png
og:image:alt: Valkey · Reducing application latency and lowering Cloud bill by setting up your client library
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Valkey · Reducing application latency and lowering Cloud bill by setting up your client library

**[Valkey](https://daily.dev/sources/valkey-blog)** · 8 min read · 0 upvotes · 0 comments

## Summary

AZ affinity routing in Valkey GLIDE (the official multi-language client for Java, Python, and Node.js) lets applications route read requests to replicas in the same availability zone as the client, cutting cross-AZ data transfer costs and reducing latency. The post explains available read strategies (PRIMARY, PREFER_REPLICA, AZ_AFFINITY, AZ_AFFINITY_REPLICAS_AND_PRIMARY), walks through cost and latency examples (e.g. dropping a $4,373/month bill to $1,088/month), and provides configuration code for setting availability-zone info and enabling AZ affinity in GLIDE clients. Valkey 8 introduced the availability-zone configuration that GLIDE relies on, and GLIDE is currently the only Valkey client supporting AZ affinity strategies.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://valkey.io/blog/az-affinity-strategy>

## Questions this post answers

### What is AZ affinity routing in Valkey GLIDE and how does it reduce cost?

AZ affinity routing directs read requests to replica nodes in the same availability zone as the client instead of any available replica, minimizing cross-AZ data transfer. In one example with a 2-shard AWS cluster processing 250MB/s, enabling AZ affinity cut the monthly bill from $4,373 to $1,088 by eliminating cross-AZ transfer charges of $0.01 per GB.

_Teams tuning cloud database spend can track infra cost-saving techniques like this one on daily.dev._

### Which Valkey client library supports AZ affinity read routing?

GLIDE (General Language Independent Driver for the Enterprise), the official open-source Valkey client, is the only Valkey client library supporting AZ affinity strategies. It supports Java, Python, and Node.js, with additional languages in development, and relies on the availability-zone configuration introduced in Valkey 8.

_Developers picking a Valkey client for production can compare capabilities like this via daily.dev._

### What are the different read-from strategies available in Valkey GLIDE?

GLIDE offers four read strategies: PRIMARY always reads from the primary for freshest data; PREFER_REPLICA round-robins across all replicas falling back to primary; AZ_AFFINITY prioritizes same-AZ replicas falling back to other replicas or primary; and AZ_AFFINITY_REPLICAS_AND_PRIMARY prioritizes same-AZ replicas, then same-AZ primary, then other zones.

_Engineers designing read paths for distributed caches can weigh these tradeoffs through daily.dev._

## Similar posts on daily.dev

- [Using Valkey on Azure and in .NET Aspire](https://daily.dev/posts/using-valkey-on-azure-and-in-net-aspire-8hoh4cisd) · InfoWorld · 0 upvotes · 0 comments
- [Valkey just had a 17x year. Its lead maintainer still doesn’t want Redis to die.](https://daily.dev/posts/valkey-just-had-a-17x-year-its-lead-maintainer-still-doesn-t-want-redis-to-die--hymzgle9p) · The New Stack · 2 upvotes · 0 comments
- [AWS Introduces Durable Storage Option for ElastiCache for Valkey](https://daily.dev/posts/aws-introduces-durable-storage-option-for-elasticache-for-valkey-w3oihx74d) · InfoQ · 0 upvotes · 0 comments
- [AWS RTB Fabric now supports configurable Availability Zone affinity](https://daily.dev/posts/aws-rtb-fabric-now-supports-configurable-availability-zone-affinity-sqdl7ujth) · AWS · 0 upvotes · 0 comments

---

Tags: [#distributed-systems](https://daily.dev/tags/distributed-systems), [#redis](https://daily.dev/tags/redis), [#finops](https://daily.dev/tags/finops), [#valkey](https://daily.dev/tags/valkey)

[View this post on daily.dev](https://daily.dev/posts/valkey-reducing-application-latency-and-lowering-cloud-bill-by-setting-up-your-client-library-svznp0ys9)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Valkey · Reducing application latency and lowering Cloud bill by setting up your client library","url":"https://daily.dev/posts/valkey-reducing-application-latency-and-lowering-cloud-bill-by-setting-up-your-client-library-svznp0ys9","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/valkey-reducing-application-latency-and-lowering-cloud-bill-by-setting-up-your-client-library-svznp0ys9"},"datePublished":"2026-08-23T12:23:22.238Z","dateModified":"2026-08-23T12:53:20.504Z","description":"AZ affinity routing in Valkey GLIDE (the official multi-language client for Java, Python, and Node.js) lets applications route read requests to replicas in the...","image":"https://media.daily.dev/image/upload/s--2-1xRawN--/f_auto/v1722860399/public/Placeholder%2011","thumbnailUrl":"https://media.daily.dev/image/upload/s--2-1xRawN--/f_auto/v1722860399/public/Placeholder%2011","isAccessibleForFree":true,"articleSection":"Valkey","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Valkey","logo":"https://media.daily.dev/image/upload/s--XXPzEmD8--/f_auto,q_auto/v1787487496/logos/valkey-blog?_a=BAMAMicg0","url":"https://daily.dev/sources/valkey-blog"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/valkey-reducing-application-latency-and-lowering-cloud-bill-by-setting-up-your-client-library-svznp0ys9","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"distributed-systems,redis,finops,valkey","timeRequired":"PT8M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Valkey","item":"https://daily.dev/sources/valkey-blog"},{"@type":"ListItem","position":3,"name":"Valkey · Reducing application latency and lowering Cloud bill by setting up your client library"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/valkey-reducing-application-latency-and-lowering-cloud-bill-by-setting-up-your-client-library-svznp0ys9#faq","mainEntity":[{"@type":"Question","name":"What is AZ affinity routing in Valkey GLIDE and how does it reduce cost?","acceptedAnswer":{"@type":"Answer","text":"AZ affinity routing directs read requests to replica nodes in the same availability zone as the client instead of any available replica, minimizing cross-AZ data transfer. In one example with a 2-shard AWS cluster processing 250MB/s, enabling AZ affinity cut the monthly bill from $4,373 to $1,088 by eliminating cross-AZ transfer charges of $0.01 per GB. Teams tuning cloud database spend can track infra cost-saving techniques like this one on daily.dev."}},{"@type":"Question","name":"Which Valkey client library supports AZ affinity read routing?","acceptedAnswer":{"@type":"Answer","text":"GLIDE (General Language Independent Driver for the Enterprise), the official open-source Valkey client, is the only Valkey client library supporting AZ affinity strategies. It supports Java, Python, and Node.js, with additional languages in development, and relies on the availability-zone configuration introduced in Valkey 8. Developers picking a Valkey client for production can compare capabilities like this via daily.dev."}},{"@type":"Question","name":"What are the different read-from strategies available in Valkey GLIDE?","acceptedAnswer":{"@type":"Answer","text":"GLIDE offers four read strategies: PRIMARY always reads from the primary for freshest data; PREFER_REPLICA round-robins across all replicas falling back to primary; AZ_AFFINITY prioritizes same-AZ replicas falling back to other replicas or primary; and AZ_AFFINITY_REPLICAS_AND_PRIMARY prioritizes same-AZ replicas, then same-AZ primary, then other zones. Engineers designing read paths for distributed caches can weigh these tradeoffs through daily.dev."}}]}
```

