Systems · Week 4

Mini object store

Immutable content-addressed objects on local disk as a teaching model.

Mini object store

Business constraint

Store opaque blobs with put/get by key/hash. Immutability simplifies caching and replication stories.

Naive v0

Overwrite files in place. Mutable keys with partial writes. No integrity hash.

Failure drill

Readers see partial objects. Cache invalidation nightmares. Silent corruption.

Evolution path

Iteration 1

Write to temp + fsync + atomic rename. Address by content hash (lab mini-object-store).

Iteration 2

Separate metadata index from blob layout. Deduplicate by hash.

Iteration 3

Discuss how signed URLs and CDNs sit in front of immutable objects in production.

Implementation cut

Immutability is the feature. Document GC for unreferenced blobs as a separate problem.

Numbers

Put durability after crash. Get integrity check failures = 0. Dedup savings optional metric.

Pattern tags

Self-check

  1. Why temp+rename?
  2. What does content addressing buy?
  3. How do partial writes get avoided?
  4. What is GC responsible for?
  5. How do CDNs interact with immutability?

Walkthrough

Recordings will appear here when published. Until then, work the failure drill and lab locally — pause after each iteration and write the metric that moved.

Lab package: see /systems/labs/mini-object-store/.

Open lab: mini-object-store