System Design: Multi‑Tenant Cloud Storage Service (Take‑Home)
You are tasked with designing a multi‑tenant cloud storage service that supports file upload, retrieval, copy, compression, quotas, and strong operational guarantees. Assume a typical public cloud environment and that tenants may have multiple buckets or namespaces.
Requirements
-
APIs and Copy Semantics
-
Define REST APIs for: uploading new files, retrieving files, copying files, deleting files, and listing.
-
Define copy semantics for: server‑side copy, deep copy, and copy‑on‑write (CoW).
-
Specify how metadata (e.g., content‑type, custom key/values) and permissions propagate during copy.
-
Multi‑Tenant Users and Quotas
-
Support adding users/tenants with per‑user capacity limits and tiers.
-
Describe quota accounting, enforcement at upload time (including multipart), and how copies and compression count toward quotas.
-
Compression
-
Support compressing on upload and decompressing on download.
-
Choose algorithms and where compression sits in the data path.
-
Specify how compression metadata is stored.
-
Discuss trade‑offs between CPU cost, latency, and storage savings.
-
Durability, Availability, Scalability, Consistency
-
Detail core components (object store, metadata service, index/catalog).
-
Describe partitioning/sharding, replication/erasure coding, background tasks (GC, scrubbing, rebalancing), and failure recovery.
-
Security, Auditing, Versioning, Monitoring
-
Cover authentication and authorization/ACLs and propose APIs/methods.
-
Include auditing, object versioning, and monitoring/alerting.
-
Outline tests to validate these features.