Databases 12 min read

Tencent File System (TFS): Architecture, 3D Indexing, High‑Performance Key‑Value Store, and Storage Engines

The article details Tencent File System (TFS), describing its platform components, 3D indexing techniques, high‑performance key‑value storage (TSSD) with MHT, dual‑read and smooth scaling mechanisms, hybrid index storage, host‑level FTL, Append‑Only and erasure‑coding storage engines, and how these innovations deliver scalable, low‑cost, high‑performance data storage for massive workloads.

Tencent Architect
Tencent Architect
Tencent Architect
Tencent File System (TFS): Architecture, 3D Indexing, High‑Performance Key‑Value Store, and Storage Engines

TFS (Tencent File System) is a self‑developed massive file system launched in 2006, now supporting major Tencent products such as QZone albums, WeChat Moments images, QQ mail, Weiyun, and Tencent Cloud COS, with data volume exceeding 1 EB by early 2017.

1. TFS Platform Overview TFS provides file‑level upload, download, and deletion services and consists of four layers: access, file index, index storage (TSSD), and data storage. The access layer handles core operations and simple transactions; the file index layer manages metadata; the index storage offers a distributed key‑value interface for metadata; the data storage stores file contents on mechanical disks.

2. 3D Indexing Technology The 3D indexing bridge connects index storage and data storage, comprising file index, user directory index, and deduplication index. It supports flexible file sizes (KB to tens of GB) and large directories with millions of files, and enables deduplication rates of over 36 % (QZone) and 55 % (Weiyun), improving upload speed and reducing storage cost.

Directory Index To handle massive directories, TFS splits directory listings into multiple extended records, storing keys and range information under a main directory index, which accelerates CRUD operations for directories containing millions of files.

Deduplication Index By deduplicating both files and data blocks, TFS achieves significant storage savings and faster "instant upload" for duplicate content.

3. TFS Index Storage – High‑Performance Key‑Value Store (TSSD) TSSD runs on SSD‑based distributed key‑value storage, employing Managed Hash Table (MHT) for data distribution and a hybrid index storage engine. MHT uses 1 million virtual nodes for consistent hashing, a Master node for routing, and access nodes for caching, providing fault‑tolerant, centrally controllable routing.

Dual‑Read and Smooth Scaling Dual‑read mitigates disk spikes and network jitter by reading from alternative replicas when a read times out, achieving 99.99 % of requests under 100 ms. Smooth scaling adds double‑write during data migration, allowing nodes to be added or removed without service interruption.

Hybrid Index Storage Engine The engine supports record sizes from tens of bytes to several hundred KB, combining in‑memory bucket indexes for small records (<4 KB) and separate large‑record indexes, reducing SSD write amplification and ensuring high read efficiency.

Host‑Level FTL Technology By implementing custom host‑level Flash Translation Layer (FTL) with priority‑based I/O scheduling and application‑aware garbage collection, TFS reduces SSD write amplification and improves SSD lifespan by up to six times.

4. TFS Data Storage TFS offers two storage engines: an Append‑Only engine based on paired storage units for ultra‑high performance and reliability, and an integrated erasure‑coding engine (RS 9+3) that reduces storage cost to 1.33 × while maintaining high availability.

The Append‑Only engine stores file blocks in 2 GB chunks across storage nodes, enabling single‑read data access and efficient write paths. The erasure‑coding engine encodes data into low‑cost, highly reliable fragments, supporting incremental encoding for fast data landing.

5. Summary Through 3D indexing, host‑level FTL, hybrid indexing, and both Append‑Only and erasure‑coding storage engines, TFS delivers high‑performance, low‑cost, and operationally controllable storage for massive data workloads, and will continue to evolve with geographic distribution and hardware customization.

big dataIndexingDistributed storageSSDErasure CodingKey-ValueTFS
Tencent Architect
Written by

Tencent Architect

We share insights on storage, computing, networking and explore leading industry technologies together.

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.