Design an image service that takes care of uploading, sharing and optimizing images at a…
- User
Design an image service that takes care of uploading, sharing and optimizing images at a scale of 5 million image uploads every hour. The image optimization will be specific to the device requesting it.
be creative and dive into the product details and add constraints and features you think would be important.
Core Requirements
- upload 5 million images every hour from various clients and devices
- serving images efficiently to the rendering devices
- provide analytics around how images are requested from the systems
- bandwidth consumption should be near-optimal
High-Level Requirements:
- make your high-level components operate with high availability
- ensure that the data in your system is durable, no matter what happens
- define how your system would behave while scaling up and scaling-down
- make your system cost-effective and provide a justification for the same
- describe how capacity planning helped you make a good design decision
- think about how other services will interact with your service
Micro Requirements:
- ensure the data in your system is never going in an inconsistent state
- ensure your system is free of deadlocks (if applicable)
- ensure that the throughput of your system is not affected by locking, if it does, state how it would affect
Create a design document for this system/feature stating all critical design decisions, tradeoffs, components, services, and communications. Also specify how your system handles at scale, and what will eventually become a chokepoint.
Do not create unnecessary components, just to make the design look complicated. A good design is always simple and elegant. A good way to think about it is if you were to create a separate process/machine/infra for each component and you will have to code it yourself.
- Assistant
- User
Can you give me a low-level design of the above?
- Assistant
Low-Level Design:
Image Storage:
- The image storage component should use a distributed database, such as Apache Cassandra or Amazon DynamoDB, to store the uploaded images. This will allow the system to handle high volumes of writes and reads, and will ensure that the data is durable and consistent.
- The database should be designed for high availability, with multiple replicas and automatic failover to prevent downtime.
- To improve performance, the database should use sharding and partitioning to distribute the data across multiple nodes, and should employ caching to reduce the need for slow disk access.