Design an Image Upload System
Requirements: Design a system that lets clients upload images, with well-defined CRUD APIs, correct HTTP semantics, and efficient retrieval.
Design: Define REST endpoints (POST /images to upload, GET /images/:id, DELETE /images/:id), decide on the transport protocol (HTTPS over TCP), define request/response payload shapes, appropriate status codes (201 Created, 404 Not Found, 401/403 for auth failures), headers (Content-Type: multipart/form-data for upload), and an authentication scheme (e.g. bearer tokens). Discuss the backing metadata store schema (image id, owner, storage URL, upload timestamp), the SQL used to query/join image metadata with user/album tables, query optimization, and indexing (e.g. index on owner_id and upload timestamp for fast per-user listing).