home
diamond Go Premium
Data Engineering Path  ·  PySpark

Big Data Architecture: Theoretical System Design

Series Data Engineering & Distributed Systems Series
Estimated Time ~35 Mins Quiz
Quiz Overview

FAANG-style senior system design scenarios covering HDFS pipeline failures, data skew stragglers, Active/Standby fencing, and 3x Replication vs Erasure Coding.


Scenario 1: HDFS Write Pipeline Node Failure

Problem: During an active block write (DataNode 1 → DataNode 2 → DataNode 3), DataNode 2 crashes with buffered packets in ackQueue.

Resolution Flow:
  • Pipeline Freeze & Re-queue: DFSOutputStream halts transmission and shifts all unacknowledged packets from the ackQueue back into the front of the dataQueue.
  • Re-register Pipeline: The client contacts the NameNode, which removes the crashed DataNode 2 and allocates a clean pipeline (DataNode 1 → DataNode 3) with a new Generation Stamp.
  • Self-Healing Replication: After the writing pipeline completes, the NameNode detects that the block is under-replicated (only 2 physical copies exist) and asynchronously streams a third copy to a new worker.

Scenario 2: Data Skew & Reducer Stragglers

Problem: One viral tracking key represents 90% of a 10TB dataset, causing a single Reducer task to hang at 99% for hours. Speculative execution fails to solve the lag.

Resolution Flow:
  • Why Speculative Fails: Speculative execution only resolves hardware-induced stragglers. Because the lag is caused by sheer data volume (9TB skew), backup tasks spawned will run just as slowly.
  • Fix (Key Salting): Append random hash suffixes (e.g. "hot_key_1", "hot_key_2") during the Map phase to distribute the 9TB uniformly across 50 intermediate Reducers, followed by a lightweight 2nd-stage merge job.

Scenario 3: Active/Standby Fencing & Split-Brain

Problem: An Active NameNode freezes during a long JVM GC pause. The Standby attempts auto-failover, resulting in both NameNodes trying to write edits, corrupting cluster metadata.

Resolution Flow:
  • QJM Epoch Fencing: The Standby receives a higher epoch number (e.g., Epoch 6). JournalNodes automatically reject any subsequent write requests from the old Active node (Epoch 5).
  • Active Fencing (sshfence / powerfence): ZooKeeper Failover Controller (ZKFC) logs in via SSH to forcefully terminate the frozen master (kill -9) or sends a signal via Power Distribution Units (PDU) to cut server rack power before promoting the Standby.

Scenario 4: 3x Replication vs Erasure Coding

Dimension 3x Replication Erasure Coding RS(10,4)
Disk Space (8PB Data) 24 PB (200% Overhead) 11.2 PB (40% Overhead — Saves 53.3%)
Fault Tolerance Survives loss of 2 nodes Survives loss of 4 nodes
Reconstruction Cost Zero CPU overhead (Direct copy) High CPU & network cost to decode stripes
Find this content helpful? ☕ Buy me a coffee

Entity Details

Create New Item

celebration
Enjoying the free content?

Create a free account to track your progress and save your place.

Create Free Account
help

Submit Technical Query

Have a question or run into an issue? Describe it below, upload an optional screenshot, and our engineering team will answer it!

image Attach image (optional)

Submit Feedback

build Free Developer Utility Free Tool
gavel

Privacy & Legal Disclaimer

1. Client-Side Browser Processing

All utility tools on DeepEngineerHub (including Image to PDF, Text Formatters, JSON Converters, and Encryptors) execute 100% locally within your client browser using WebAssembly and JavaScript. No uploaded images, text, or documents are transmitted, collected, or stored on remote servers.

2. Limitation of Liability ("As-Is" Provision)

Tools and services are provided free of charge for convenience and educational purposes "as-is" without warranties of any kind. DeepEngineerHub shall not be held liable for any data loss, formatting inconsistencies, or indirect damages resulting from tool usage.

3. Open Source & Third-Party Software

Certain utilities utilize open-source client libraries (such as jsPDF, Mermaid.js, Pyodide) licensed under MIT, Apache, or BSD open licenses. All intellectual property remains with their respective copyright holders.