System-Design-Notes

[System Design] S3-like Object Storage

Storage System

Untitled

Storage System

Bucket & Object

A bucket is a logical container for objects. An object is an individual piece of data we store in a bucket, which contains object data (payload) and metadata.

Use versioning to keep multiple variants of an object in the same bucket. The object storage provides RESTful APIs to access its resources, which are uniquely identified by its URI.

The data store (payload) contains immutable data while the metadata store (metadata) contains mutable data.

Untitled

`

High-level design

Untitled

Data Store

Untitled

Data Store

Data organization for small objects

Untitled

Small files could waste data blocks (~4KB) and exceed the inode capacity.

When we save an object, it is appended to an existing read-write file. When the file reaches its capacity threshold (~GB), mark it as read-only and a new read-write file is created.

Erasure coding

It chunks data into smaller pieces (placed on different servers) and creates parities for redundancy.

In the event of failures, can use chunk data and parities to reconstruct. Use a more complex solution with a slower access speed, in exchange for higher durability and lower storage cost.

Untitled

Correctness verification

Untitled

Untitled