System Design Task: Filesystem-Only, Multi-tenant, Deduplicated File Storage
You are asked to design a multi-tenant file storage service with the following constraints and requirements:
-
Only OS filesystem APIs are allowed (e.g., directories/files, permissions, hard links/symlinks, atomic rename, file locks, fsync). No databases or external KV stores.
-
Users belong to tenants; tenants must be isolated from each other.
-
Identical files must be deduplicated.
-
Define and justify the following:
-
Authentication and authorization (who can upload, read, delete).
-
Object naming and tenant namespace layout.
-
External APIs (upload, get, delete; optionally list, head, copy).
-
Content-addressed storage and deduplication strategy.
-
Reference counting and garbage collection.
-
Consistency and concurrency semantics under concurrent uploads/updates/deletes.
-
Scaling across multiple storage nodes (sharding, replication assumptions, routing).
Assume a POSIX-like environment supporting atomic rename, hard links, advisory file locks, and SHA-256 hashing.