Tag

Simple Dynamic String

1 views collected around this technical thread.

Java Tech Enthusiast
Java Tech Enthusiast
Jan 4, 2024 · Databases

Redis Simple Dynamic String (SDS) Implementation Overview

Redis implements its own Simple Dynamic String (SDS) instead of plain C strings because SDS stores length for O(1) queries, pre‑allocates extra space and lazily reuses freed bytes, prevents buffer overflows, handles binary data, and uniformly backs all string keys, values and container elements.

C languageRedisSDS
0 likes · 8 min read
Redis Simple Dynamic String (SDS) Implementation Overview
Wukong Talks Architecture
Wukong Talks Architecture
Jul 21, 2021 · Fundamentals

Understanding Redis Simple Dynamic Strings (SDS): Structure, Benefits, and Memory Management

This article explains the Redis Simple Dynamic String (SDS) data structure, comparing it with traditional C strings, detailing its struct layout, O(1) length retrieval, pre‑allocation strategy, lazy space release, and provides code examples illustrating how SDS avoids buffer overflows and improves performance.

C stringsRedisSDS
0 likes · 11 min read
Understanding Redis Simple Dynamic Strings (SDS): Structure, Benefits, and Memory Management