Architecture

KDSS keeps metadata and data apart. A Master cluster backed by a MongoDB replica set tracks where data lives; storage nodes own the raw disks and hold the data itself. Clients erasure-code locally and write shards to many nodes in parallel. Every shard is verified on read, and missing ones are rebuilt on the spot.

Overview

Three tiers, each scaling on its own

The access tier offers both POSIX and S3 entry points. The control tier handles metadata, leader election and background scheduling. The data tier is a pool of storage nodes that scales out to dozens of servers.

KDSS architecture: access tier (ksfs, S3 gateway, web console), Master cluster with MongoDB replica set, and storage nodes

Swipe to see the full diagram

Dashed blue lines are the data path: shards move directly between clients and storage nodes, never through the Master.

Metadata separate from data

The Master records data locations per stripe — one record per 256 MB of data, plus directory and file metadata — so metadata stays small, and it never sits in the data path.

Encoding at the client

Clients erasure-code locally and write shards straight to storage nodes, spreading write traffic across the whole cluster.

No single point of failure

Multiple Masters with automatic leader election, majority writes to MongoDB, and shards spread across different nodes.

Components

Components and ports

What each component does and the port it listens on by default. Open these in your firewall as needed.

ComponentRoleDefault port
MasterMetadata and leader election; schedules repair, rebalancing, garbage collection and placement auditsgRPC 6700
metrics 6701
StorageRaw-disk I/O, node-side local reconstruction, disk health monitoringgRPC 6800
metrics 6801
Web consoleCluster, node and disk views; capacity panel; buckets and access keys; alerts; audit log; user management8081
S3 gatewayS3-compatible API for AWS CLI, boto3, s3cmd, the Go SDK and similar tools9000
MongoDB replica setHolds the inodes, dentries, stripes, nodes and buckets collections; zstd compression, majority writesPer your MongoDB deployment
ksfs clientFUSE mount with a POSIX interface; performs erasure coding on the client—
Metrics ports expose Prometheus metrics under the kdss_* namespace, and /metrics supports Bearer-token authentication. gRPC between components can optionally use mTLS; it can stay off on a trusted internal network.
Write path

Buffer, encode, write in parallel, commit

Shown for a FUSE client with EC 29+3. Metadata is committed once all data shards and at least one parity shard are written; repair fills in any missing shards.

Write path: the client buffers 256 MB, requests a stripe from the Master, encodes 32 shards locally, writes them to 32 different nodes in parallel, and commits metadata once all data shards and at least one parity shard are written

Swipe to see the full diagram

Buffer

The client buffers incoming writes until it has a full 256 MB block.

Request a stripe

It asks the Master leader for a stripe and receives a stripe ID and 32 target nodes.

Encode locally

Reed-Solomon (SIMD-accelerated) produces 29 data shards and 3 parity shards of about 8.8 MiB each.

Write in parallel

All 32 shards go to 32 different nodes at once. Each storage node appends to its raw disk and persists according to the fsync policy.

Commit metadata

Once all 29 data shards and at least one parity shard are written, the client commits the stripe metadata to the Master, which writes it to a MongoDB majority. Repair fills in any parity shards that did not land.

Writes are always served by the leader. A client that reaches a non-leader Master is redirected automatically, so leader changes are invisible to applications.
Read path

Every shard verified, missing shards decoded on the fly

A shard is used only after it passes a CRC32 check and an identity check. A missing shard does not fail the read — the data is reconstructed from the others in real time.

Read path: look up stripe locations from the Master, read shards in parallel with verification, rebuild missing or corrupt shards from any 29 survivors, return data

Swipe to see the full diagram

Look up locations

The client asks the Master which node holds each shard of the stripe.

Read in parallel

All shards are read at once. Each is CRC32-checked and its stripe ID and shard index are verified, so a misrouted read can never return someone else's data. Streaming reads are verified the same way.

Decode what is missing

If shards are missing or fail verification, the rest are decoded in real time. With EC 29+3, any 29 shards are enough to return complete data.

Return data

The reconstructed data goes back to the application; the repair process rebuilds the missing shards on the storage side.

Erasure coding

Stripes and placement: one stripe, 32 nodes

Each 256 MB block is one stripe. Large stripes keep metadata small — data locations are recorded per stripe, plus directory and file metadata — and production clusters manage hundreds of millions of stripes.

Stripe placement: the 32 shards of a stripe are placed on 32 different nodes, one shard per node

Swipe to see the full diagram

Placement rule

  • Shards of a stripe never share a node, so losing any one node costs each stripe at most one shard.
  • The rule is enforced on every write, repair and rebalance.
  • A background placement audit sweeps the whole cluster continuously.

Repair

  • Node-side reconstruction: the storage node pulls surviving shards, decodes locally and writes the result, avoiding an extra hop.
  • Worst-first ordering by number of missing shards; repair tasks for hundreds of thousands of stripes are queued within minutes and claimed by multiple Masters.
  • In-place repair: after a disk swap, data is written back to the same location on the new disk.
SchemeMin. nodesEfficiencyTolerates
EC 5+2871.4%2
EC 9+21281.8%2
EC 18+32285.7%3
EC 29+33390.6%3

These schemes are selected automatically from the node count and are conservative defaults. Higher-density schemes such as 19+3, 21+3, 22+3, 31+3 and 31+2 are enabled manually. See capacity planning for details.

Storage engine

Raw-disk layout: no file system, append-only

Storage nodes bypass the local file system and write the block device directly. Sequential, 4 KB-aligned appends mean less head seeking, which helps extend drive life.

Raw-disk layout: primary and backup superblocks in the first 4 KB, then 4 KB-aligned records (header, shard data, padding) appended sequentially; holes left by deletes are reused by writes of the same size

Swipe to see the full diagram

Schematic; regions are not drawn to scale.

Superblocks and disk identity

Primary and backup superblocks, CRC-protected. Each disk carries its node ID, disk ID and UUID, so moved slots or renamed devices are corrected at startup and a wrong disk is refused.

Records and verification

The local index is BadgerDB. Every read is CRC32-checked, streaming reads included; a background CRC scrub can be rate-limited (20 MB/s per node by default).

Crash recovery

Clean shutdowns restart in seconds. After a power loss, the index is completed by scanning forward from the write head; an interrupted compaction can rebuild the index from the whole disk. All disks open in parallel.

fsync policy

Choose immediate (default, every write persisted), batch (group commit) or deferred (flushed in the background every 5 seconds; a power loss can lose up to the last ~5 seconds of writes — for hardware with power-loss protection where that window is acceptable).

Space reuse and defragmentation

Deletes are soft: after the recycle bin and a freeze period, holes are reused by writes of exactly the same size. Defragmentation moves tail data into holes, verifies it, then truncates.

Three-level capacity protection

At the cluster reject line (99% by default) new writes stop but repair continues; a disk at its limit (99.5% by default) takes repairs only; a disk with under 4 GiB left becomes read-only.

High availability

Multiple Masters, upgrades without downtime

The control tier has no single point of failure: if any Master fails, leadership moves automatically. By default, storage nodes are upgraded one at a time while reads and writes continue.

Replicated Masters

A typical deployment runs 5 Masters, which elect a leader through the MongoDB replica set.

Majority writes

Metadata is acknowledged only after a majority of the MongoDB replica set has it.

Automatic failover

If the leader fails, another Master takes over without operator action.

Write redirection

Writes are redirected to the current leader automatically; applications never notice the switch.

Rolling upgrade

Enter maintenance

The node is cordoned and stops accepting new writes.

Drain in-flight writes

Writes already in progress are allowed to finish.

Replace and verify

Swap the binary, restart and confirm the node is healthy.

Exit maintenance, move on

One node at a time by default, fully transparent to applications.

The number of nodes in maintenance at the same time is capped at parity shards − 1. With EC 29+3, that means at most 2 nodes at a time.
Deployment

Hybrid nodes plus storage-only nodes

Masters can share hosts with Storage on nodes whose system disk is RAID1; all other nodes run Storage only. Need more capacity? Add storage nodes.

Deployment topology: the access tier connects over the data network to hybrid nodes (Master + Storage), the MongoDB replica set and storage-only nodes

Swipe to see the full diagram

ItemRecommendation (from production)
Storage node36 × 16 TB enterprise HDDs (JBOD pass-through), 20-core-class Xeon CPU, 64 GB RAM
Network2 × 10 GbE bonded per node (20 Gbps)
System diskRAID1; Masters run on nodes with a RAID1 system disk
MasterTypically 5, co-located with Storage
MongoDB replica setOn SSD
Minimum size8 nodes (EC 5+2)

Hardware and capacity planning →

Want a deployment plan for your data center?

Tell us about your data volume, access patterns and hardware, and we will recommend node counts, an erasure-coding scheme and a network layout.