Design a bulk Image Tagging System
Difficulty: MEDIUMCategory: HLDFrequency: 1Asked On 2024-06-04
Problem Statement
Design a bulk image tagging system that can process millions of images, extract metadata (tags), and store them for efficient retrieval, analytics, and search. The system should support automatic tagging (ML/AI-based), manual tagging (human moderation), and bulk operations, while ensuring scalability and low latency for read/write operations.
🔶 Functional Requirements
1.Image Ingestion
•Upload images individually or in bulk (via API, UI, or batch job).
•Support large-scale ingestion (thousands of images per second).
2.Tag Generation
•Automated tagging using ML models (object detection, OCR, face recognition, etc.).
•Manual tagging by users or moderators.
•Support multiple tag categories (objects, colors, locations, events, etc.).
3.Storage & Indexing
•Store image metadata (tags, upload time, uploader info).
•Index tags for fast search and retrieval.
•Store original image in blob/object storage (e.g., S3, GCS).
4.Search & Retrieval
•Search by tags, uploader, date, or metadata filters.
•Support queries like “all images tagged with cat + beach + 2023”.
5.Bulk Operations
•Apply tags to multiple images at once.
•Delete or reprocess images in bulk.
6.Scalability & Processing
•Handle batch jobs for millions of images.
•Parallelize tagging and metadata extraction.
•Retry & error handling for failed image processing.
7.APIs & Integration
•Provide APIs for uploading images, retrieving tags, and searching.
•Support integration with external ML services (AWS Rekognition, Google Vision API).
🔶 Non-Functional Requirements
•Scalability: Must scale to billions of images and metadata records.
•Performance: Tagging pipeline should process images within a few seconds.
•High Availability: 99.9% uptime for APIs.
•Consistency: Tags must be reliably stored and searchable.
•Durability: Images and metadata must not be lost.
•Extensibility: Easy to plug in new ML models or tagging rules.
🔶 Constraints
•Images may be large (up to 50MB) → need efficient storage.
•Metadata size grows rapidly → must use distributed indexing (ElasticSearch/Solr).
•Bulk uploads may cause spikes → system should handle burst traffic.
•Must support multi-tenant use cases (different organizations/users).
🔶 Example Use Cases
1.A media company uploads 1M photos → system auto-tags them by people, objects, and locations.
2.A user uploads personal photos → system auto-tags them (e.g., “dog, park, sunset”).
3.A moderator bulk-tags images with “inappropriate” for filtering.
4.A search query → “Show me all red cars uploaded last week.”
5.An e-commerce platform bulk-processes product images → tags them with “shoes, sports, Nike.”
👉 Summary:
"Design a scalable Bulk Image Tagging System that supports automatic and manual tagging, bulk ingestion and processing, efficient storage and indexing of metadata, real-time search over billions of images, and ensures high performance, availability, and extensibility."