API Design for Dropbox System Design

6.1 Download Chunk

This API would be used to download the chunk of a file.

Request




GET /api/v1/chunks/:chunk_id
X-API-Key: api_key
Authorization: auth_token


Response




200 OK
Content-Disposition: attachment; filename="<chunk_id>"
Content-Length: 4096000


The response will contain Content-Disposition header as attachment which will instruct the client to download the chunk. Note that Content-Length is set as 4096000 as each chunk is of 4 MB.

6.2 Upload Chunk

This API would be used to upload the chunk of a file.

Request




POST /api/v1/chunks/:chunk_id
X-API-Key: api_key
Authorization: auth_token
Content-Type: application/octet-stream
/path/to/chunk


Response




200 OK


6.3 Get Objects

This API would be used by clients to query Meta Service for new files/folders when they come online. Client will pass the maximum object id present locally and the unique device id.

Request




GET /api/v1/objects?local_object_id=<Max object_id present locally>&device_id=<Unique Device Id>
X-API-Key: api_key
Authorization: auth_token


Response




200 OK
{
  new_objects: [
    {
      object_id:
      object_type:
      name:
      chunk_ids: [
        chunk1,
        chunk2,
        chunk3
      ]
    }
  ]
}


Meta Service will check the database and return an array of objects containing name of object, object id, object type and an array of chunk_ids. Client calls the Download Chunk API with these chunk_ids to download the chunks and reconstruct the file.

Design Dropbox – A System Design Interview Question

System Design Dropbox, You might have used this file hosting service multiple times to upload and share files or images. System Design Dropbox is a quite common question in the system design round. In this article, we will discuss how to design a website like Dropbox.

Important Topics for the Dropbox System Design

  • Requirements Gathering for Dropbox System Design
  • Capacity Estimation for Dropbox System Design
  • High-Level Design(HLD) of Dropbox System Design
  • Low-Level Design(LLD) of Dropbox System Design
  • Database Design for Dropbox System Design
  • API Design for Dropbox System Design
  • Scalabilty for Dropbox System Design

Similar Reads

1. Requirements Gathering for Dropbox System Design

Functional Requirements:...

2. Capacity Estimation for Dropbox System Design

Storage Estimations:...

3. High-Level Design(HLD) of Dropbox System Design

...

4. Low-Level Design(LLD) of Dropbox System Design

A lot of people assume designing a Dropbox is that all they just need to do is to use some cloud services, upload the file, and download the file whenever they want but that’s not how it works. The core problem is “Where and how to save the files? “. Suppose you want to share a file that can be of any size (small or big) and you upload it into the cloud....

5. Database Design for Dropbox System Design

To understand Database design one should understand...

6. API Design for Dropbox System Design

...

7. Scalabilty for Dropbox System Design

...

8. Conclusion

...

Contact Us