StorageSenior Level

Google Drive & Dropbox File Sync Engine

Sync multi-gigabyte files across millions of devices with 4MB chunking, content-addressable storage, and delta synchronization.

Target Scale

Engineering Scale & Performance SLAs

Target production parameters expected in a senior or staff interview round.

Peak Throughput

50,000 Sync QPS Peak

Sustained peak request volume during high-traffic events.

Active Users

100 Million DAU

Daily active users generating read and write operations.

Storage Ingestion

500 TB/day new files

Projected data ingestion and replication storage capacity.

Latency Budget

Delta sync notification < 500ms

Strict end-to-end percentile latency SLA constraint.

Stage 01

Functional & Non-Functional Requirements

Establish clear problem boundaries before proposing architectural components.

Functional Scope

Core System Capabilities

  • Upload, download, and sync files across desktop, mobile, and web clients.
  • Automatic delta sync (only upload modified 4MB chunks of a file).
  • File revision history and rollback up to 30 days.
  • Offline editing and conflict resolution when reconnecting.
Non-Functional Scope

Reliability & Latency SLAs

  • Strong data durability (99.999999999% across multiple regions).
  • Sub-500ms sync notification latency across connected devices.
  • Bandwidth optimization using client-side deduplication.
Stage 02

Capacity Estimation Math

Step-by-step arithmetic conversions for QPS, storage, and bandwidth.

DimensionCalculation FormulaEstimated Result
Daily Ingestion Volume100M DAU * 0.5 file updates/day * 10 MB avg file size500 TB/day raw file data
Chunk Ingestion Throughput500 TB / 86,400s / 4 MB chunk size1,450 chunks uploaded/second (5.78 GB/s)
Metadata Storage per Year50M daily file operations * 365 days * 1 KB metadata record18.25 TB/year metadata growth
Stage 03

Multi-Tier Architecture & Component Topology

How requests navigate ingress gateways, application logic, caching, and persistence.

Client Sync Agent Tier

Local Chunking Engine · Local SQLite Database · File Watcher Daemon

Monitor filesystem events, split files into 4MB chunks, compute SHA-256 hashes, and coordinate delta sync.

Block Storage & Dedup Tier

Block Service · Content-Addressed S3/Blob Storage · Chunk Hash Metadata Store

Store encrypted immutable 4MB chunks and skip upload if hash already exists globally (client deduplication).

Metadata & Namespace Tier

Metadata Service · PostgreSQL / CockroachDB · Redis Distributed Lock

Track directory tree hierarchies, file version trees, chunk manifest lists, and user permissions.

Real-Time Notification Tier

Notification Service · WebSocket Cluster · Redis Pub/Sub Channel

Broadcast file change events to all active devices paired with the user account within 500ms.

Stage 04

Database Schemas & Partitioning Strategy

Entity models, indexing, and primary key partitioning.

Table: file_metadata

PK: file_id

  • file_id (UUID PK)
  • account_id (UUID)
  • parent_folder_id (UUID)
  • file_name (VARCHAR(255))
  • latest_version (INT)
  • is_deleted (BOOLEAN)

Composite index on (account_id, parent_folder_id) for fast directory browsing.

Table: file_versions

PK: version_id

  • version_id (UUID PK)
  • file_id (UUID)
  • version_number (INT)
  • chunk_hashes (JSONB ARRAY)
  • size_bytes (BIGINT)
  • created_at (TIMESTAMP)

Index on (file_id, version_number) for rapid revision history retrieval.

Table: block_catalog

PK: chunk_hash

  • chunk_hash (VARCHAR(64) PK)
  • storage_path (VARCHAR(512))
  • size_bytes (INT)
  • ref_count (BIGINT)

SHA-256 content-addressable key for cross-user block-level deduplication.

Stage 05

Critical Architectural Trade-Offs

How to defend engineering compromises when challenged by interviewers.

Decision Point

Chunk Size Selection: 4MB vs Variable Sized Rolling Chunks (Rabin Fingerprints)

Option A: Fixed 4MB Chunks
Option B: Variable Sized Chunks via Content-Defined Chunking (CDC / Rabin)

Rationale: Fixed chunks cause boundary shift invalidations if bytes are inserted at the start. Variable-sized chunks identify boundaries by byte content, ensuring only altered blocks re-upload.

Decision Point

Sync Protocol: Long Polling vs WebSockets

Option A: HTTP Long Polling
Option B: Persistent WebSockets

Rationale: WebSockets maintain low-latency bidirectional connections, allowing instant push notifications when other clients edit shared files without repeated HTTP handshake overhead.

Technical FAQ

Frequently Asked Questions: Google Drive & Dropbox File Sync Engine

Key interview questions and conceptual defenses.

How does Dropbox handle simultaneous edits to the same file by two devices?

The first committer's version increments the version counter. The second committer receives a version conflict error and creates a 'Conflicted Copy' branch fork.

Why is client-side deduplication critical for cloud storage?

If multiple users upload the exact same 1GB movie or installer, the client computes chunk hashes and checks the catalog. If chunks already exist, no upload occurs, saving 99% bandwidth.

Simulate this architecture

Practice Google Drive & Dropbox File Sync Engine with ClawPad's interactive diagram overlay.

Download ClawPad