educative.io

Questions on Instagram API Design

Posting this again as I did not see any response to Franklin’s post
Few questions:

  1. Can I know the detailed API design part? there are lot of questions based on the API such as
    a) When user uploads the photo, what would the API look like?
    b) Will the API need Photo Id to upload, if Yes then how would it be generated
    c) When user uploads the photo, usually they select the photo where it is already at a particular location on the phone (like photos/folders etc.,) What parameters are passed to the API and how will this photo be transferred thru API?
    c) How would the PhotoId linked to the Storage as it is going to be separate from the table. Will the table have the link to the Photo Path?

a) Parameters can be :

  1. Authenticated userid
  2. Photo path that server can read.
  3. location
  4. Title
    There must be multiple ways to read this file at server side using jsp servlets or any other framework

Once you have the photo you can generate the photo id and updload to your storage either HDFS or S3. Once you have the URL for the uploaded photo, service can hash the photo id to the owner shard and call database.save()