Grokking the System Design Interview
Ask Author
Back to course home

0% completed

Vote For New Content
When partitioning based on PhotoID, does this not still have the issue where a u...

DogBiscuit

Feb 28, 2022

When partitioning based on PhotoID, does this not still have the issue where a user's photos maybe be on multiple shards? Would this still cause higher latency for getting all of a user's photos?

1

0

Comments
Comments
A
Aruna Kalagnanam4 years ago

My approach for retrieving by userId : Create another table say photos_by_userId, where userId is the partition key and will hold the links to the photos uploaded by the user. Using NoSQL data stores means that tables will denormialized, so there will be duplication. Wi...

S
Szymon a year ago

Indeed partition on PhotoID wouldn't make sense with proposed schema you need additional table as suggested by Aruna to find mapping between UserID to PhotoID.

On this page

  1. What is Instagram?

Try it yourself

Designing Instagram (video)

  1. Requirements and Goals of the System
  1. Some Design Considerations
  1. Capacity Estimation and Constraints
  1. High Level System Design
  1. Database Schema
  1. Data Size Estimation
  1. Component Design
  1. Reliability and Redundancy
  1. Data Sharding
  1. Ranking and News Feed Generation
  1. News Feed Creation with Sharded Data
  1. Cache and Load balancing