Object storage
Files go to a cluster that spreads each object over many disks and moves it to cheaper storage as it ages.
The CityScript
This is all there is to it. Change it in the editor and the city redraws.
%% O · Object storage
%% An S3 API in front of a cluster: objects are erasure coded across nodes and tier down as they cool.
%% Prices are made up for the example, to show a cost line: what a service costs, with its vendor, plan and spec.
city 48x32
district clients "Clients" 3,3..13,13
district store "Object store" 18,3..45,19
building uploads factory in clients "Uploads"
floor uploads.f "App"
room uploads.api service "Upload API" port=8080
building s3 tower in store "S3 gateway"
floor s3.f "API"
room s3.api proxy "S3 API" port=9000
room s3.iam config "Access policies"
building node-1 warehouse in store "Node 1"
floor node-1.f "Disks"
room node-1.d1 storage "Disk 1"
cost 90 "Storage server" vendor=Hetzner plan=SX65 spec="4 x 22 TB HDD"
room node-1.d2 storage "Disk 2"
building node-2 warehouse in store "Node 2"
floor node-2.f "Disks"
room node-2.d1 storage "Disk 1"
cost 90 "Storage server" vendor=Hetzner plan=SX65 spec="4 x 22 TB HDD"
room node-2.d2 storage "Disk 2"
building node-3 warehouse in store "Node 3"
floor node-3.f "Disks"
room node-3.d1 storage "Disk 1"
cost 90 "Storage server" vendor=Hetzner plan=SX65 spec="4 x 22 TB HDD"
building archive depot in store "Cold archive"
floor archive.f "Glacier"
room archive.vault storage "Archive vault"
cost 50 "Cold archive" vendor=AWS plan="S3 Glacier Deep Archive" spec="50 TB"
pipeline lifecycle "Object lifecycle" s3 -> [warm-after-30d] -> [archive-after-1y] -> archive
step s3 "A file is stored in fast storage"
step archive "After a year it moves to cheap archive storage"
link uploads.api -> s3.api "S3 PUT" variant=emphasis
link s3.iam -> s3.api "policy" variant=security
link s3.api -> node-1.d1 "erasure shards"
link node-1.d1 -> node-2.d1 -> node-3.d1 "shard copy" variant=dashed