---
title: "Astra Dynamic Chunks: How We Saved by Redesigning a Key Part of Astra"
description: "Slack's Astra log search engine replaced fixed-size chunk slots on cache nodes with dynamically sized chunks, because undersized chunks wasted allocated disk space and oversized chunks from recovery tasks could overflow their slots."
url: "https://swe.quest/articles/astra-dynamic-chunks-how-we-saved-by-redesigning-a-key-part-of-astra-2ad19dfa88650f39"
canonical: "https://slack.engineering/astra-dynamic-chunks-how-we-saved-by-redesigning-a-key-part-of-astra/"
source: "Slack Engineering"
published: "2024-11-18"
difficulty: "medium"
kind: "Case study"
reading_minutes: 6
tags: ["search","cost-optimization","storage-systems","algorithms","deployment"]
---

# Astra Dynamic Chunks: How We Saved by Redesigning a Key Part of Astra

A post on [Slack Engineering](https://swe.quest/sources/slack.md), published 2024-11-18, 6 min read, Case study. Original: [https://slack.engineering/astra-dynamic-chunks-how-we-saved-by-redesigning-a-key-part-of-astra/](https://slack.engineering/astra-dynamic-chunks-how-we-saved-by-redesigning-a-key-part-of-astra/)

## Summary

Slack's Astra log search engine replaced fixed-size chunk slots on cache nodes with dynamically sized chunks, because undersized chunks wasted allocated disk space and oversized chunks from recovery tasks could overflow their slots. Cache nodes now advertise disk capacity, and the manager persists chunk-to-node assignments and node metadata in ZooKeeper, using first-fit bin packing to place chunks onto as few nodes as possible. The rollout ran behind a feature flag on one of two data replicas, moving from small clusters to large ones. It cut cache nodes by up to 50% on clusters with many undersized chunks and reduced overall cache node cost by 20%.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Search](https://swe.quest/tags/search.md) (Backend & APIs)
- [Cost optimization](https://swe.quest/tags/cost-optimization.md) (Reliability & operations)
- [Storage systems](https://swe.quest/tags/storage-systems.md) (Infrastructure)
- [Algorithms](https://swe.quest/tags/algorithms.md) (Architecture & design)
- [Deployment](https://swe.quest/tags/deployment.md) (Reliability & operations)

## Prerequisites

- ZooKeeper coordination basics
- log search systems ([easy posts on Search](https://swe.quest/tags/search.md?difficulty=easy))

## Keywords

Astra, ZooKeeper, Slack, bin packing

## Related posts

- [ClickHouse Keeper: A ZooKeeper alternative written in C++](https://swe.quest/articles/clickhouse-keeper-a-zookeeper-alternative-written-in-c-982cab848c27cdde.md): ClickHouse · 2023-09-27 · Medium · 16 min read · Consensus, Distributed systems, Performance engineering, Analytics & OLAP, C & C++
  ClickHouse Keeper is a C++ drop-in replacement for ZooKeeper with the same client protocol and data model.
- [Singapore Meetup Report: How ClickHouse Powers Ahrefs, the World's Most Active Web Crawler](https://swe.quest/articles/singapore-meetup-report-how-clickhouse-powers-ahrefs-the-world-s-most-active-53c5d742aa6dea19.md): ClickHouse · 2023-07-27 · Easy · 3 min read · Analytics & OLAP, Storage engines, Scaling, Replication
  Ahrefs moved its web-crawler and analytics storage from a custom system built on Quantcast File System plus Elasticsearch to ClickHouse in 2019.
- [Building high-performance full-text search for object storage](https://swe.quest/articles/building-high-performance-full-text-search-for-object-storage-7061dd61b5d19a17.md): ClickHouse · 2026-03-24 · Hard · 33 min read · Search, Storage engines, Data structures, Analytics & OLAP, Performance engineering
  ClickHouse redesigned its full-text index for object storage, where per-request latency rather than bandwidth is the bottleneck.
- [From Files to Chunks: Improving HF Storage Efficiency](https://swe.quest/articles/from-files-to-chunks-improving-hf-storage-efficiency-389481ed0fa30735.md): Hugging Face · 2024-11-20 · Medium · 5 min read · Storage systems, Algorithms, Version control, Cost optimization
  Hugging Face's Xet team plans to replace file-level Git LFS storage with content-defined chunking (CDC), where a rolling hash over a sliding window sets variable-size chunk boundaries and chunks are deduplicated in a content-addressed store, so edits only upload and store changed chunks.
- [From Chunks to Blocks: Accelerating Uploads and Downloads on the Hub](https://swe.quest/articles/from-chunks-to-blocks-accelerating-uploads-and-downloads-on-the-hub-0403426cd59197cb.md): Hugging Face · 2025-02-12 · Medium · 9 min read · Storage systems, ML platforms, Data structures, Performance engineering
  Hugging Face's Xet storage backend uses content-defined chunking for deduplication but avoids per-chunk overhead by aggregating chunks into content-addressed blocks of up to 64MB and using shards to map files to chunks.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
