# Scaling HNSWs

DevFeed: [Scaling HNSWs](<https://devfeed.tech/articles/scaling-hnsws-20647.md>)

Original publisher: [Read original article](<http://antirez.com/news/156>)

Published: 2025-11-11T12:53:38Z

Content type: article

Language: en

Sources: [Antirez](<https://devfeed.tech/sources/antirez.md>)

Topics: [Data structures](<https://devfeed.tech/topics/data-structures.md>), [Redis](<https://devfeed.tech/topics/redis.md>), [Low Latency](<https://devfeed.tech/topics/low-latency.md>), [Latency](<https://devfeed.tech/topics/latency.md>)

Tags: [blog-post](<https://devfeed.tech/tags/blog-post.md>), [data-structures](<https://devfeed.tech/tags/data-structures.md>), [latency](<https://devfeed.tech/tags/latency.md>), [performance](<https://devfeed.tech/tags/performance.md>), [redis](<https://devfeed.tech/tags/redis.md>), [time](<https://devfeed.tech/tags/time.md>)

## AI overview

An advanced blog post about HNSW internals, optimizations, and the challenges of integrating HNSW vector similarity search into Redis while maintaining low latency and high performance. The author also questions whether HNSWs are the final approach for greedy nearest-vector search.

## Source excerpt

I'm taking a few weeks of pause on my HNSWs developments (now working on some other data structure, news soon). At this point, the new type I added to Redis is stable and complete enough, it's the perfect moment to reason about what I learned about HNSWs, and turn it into a blog post. That kind of brain dump that was so common pre-AI era, and now has become, maybe, a bit more rare. Well, after almost one year of thinking and implementing HNSWs and vector similarity stuff, it is time for some writing. However this is not going to be an intro on HNSWs: too many are present already. This is the "extra mile" instead. If you know HNSWs, I want to share with you my more "advanced" findings, especially in the context of making them fast enough to allow for a "Redis" experience: you know, Redis is designed for low latency and high performance, and HNSWs are kinda resistant to that, so there were challenges to expose HNSWs as an abstract data structure. This blog post will be split into several sections. Think of them as pages of the same book, different chapters of the same experience. Oh and, by the way, I already wrote and subsequently lost this blog post :D [long, sad story about MacOS and bad habits - I hadn't lost something like that since the 90s, during blackouts], so here most of the problem will be to recall what I wrote a few days ago and, while I'm at it, to better rephrase what I didn't like very much. ## A few words about the state of HNSW Before digging into the HNSWs internals and optimizations, I want to say a few things about HNSWs. The original paper introducing HNSWs is a great piece of computer science literature, and HNSWs are amazing data structures, but: I don't believe they are the last word for searching, in a greedy way, for nearby vectors according to a distance function. The paper gives the feeling it lacks some "pieces", almost like if the researchers, given six months more, had a lot more to explore and say. For instance, I modified the paper m