{
"$type": "site.standard.document",
"coverImage": {
"$type": "blob",
"ref": {
"$link": "bafkreigc6y4xmb3pl7dnm46t7jo7jpdsy5sta5crlvw2lfyqqhtz6pfhxa"
},
"mimeType": "image/png",
"size": 56583
},
"description": "Every val gets its own blobs",
"path": "/scoped-blob-storage",
"publishedAt": "2026-06-11T00:00:00.000Z",
"site": "at://did:plc:a2rdzfdxkjwerrfrpbwcipb2/site.standard.publication/3jd443afc2222",
"textContent": "Since the early days, vals on Val Town have had the ability to store blobs on an\nS3-like service. Just import a val from the standard library and it works, with\nno setup or configuration. It's a tremendously useful and popular feature.\n\nWhat's a blob, you might be asking? It's binary data that you store with a name,\njust like a file. And it can be any kind of data - text, photos, music, JSON -\nit's all the same to blob storage. It's a great option for storing unstructured,\nsimple, or big data. If you've got structured data and need a database, check\nout our SQLite database support which is\njust as easy to setup.\n\nToday we're adding a new version of blob storage with two important tweaks:\n\nIt's scoped!\n\nScope blob storage is isolated by val, rather than by account. This simplifies\nthings for when you might need to transfer a val from one organization to\nanother, or list only the blobs that were created by one specific val.\n\nIn the old days (before yesterday), blob storage was scoped by your user account\nor organization. In the rare case that two vals wanted to access the same blobs,\nthis was nifty, but in the more common case we'd see vals accidentally\noverwriting each others data. And there was no connection between a blob and the\nval that wrote it, so you couldn't transfer a val without losing access to all\nof its blobs.\n\nIt's faster!\n\nAbout 5x faster on our internal benchmarks. Pretty good! I'll even give away the\nsecret: under the hood, scoped blob storage is based on good old Amazon S3.\n\nWe used Cloudflare R2 for the global blob storage system, because we were\nalready using some of the Cloudflare stack, and the egress pricing difference is\ncompelling. But in this case, proximity is the deciding factor: with an S3\nbucket in the same region as our servers, file uploads, downloads, and other\noperations involve the minimum amount of network hops. It all stays in Amazon's\nnetwork, and for small requests where latency is the biggest factor, that means\na big performance difference.\n\nView those blobs in the settings\n\n\n\nJust like for global blobs, you can list, download, and upload blobs from the\nwebsite, not just from code. Check it out with the new Blob Storage menu item\nfrom vals.\n\nScoped blob storage: a solid new default\n\nIf you're using Val Town's MCP servers, skills, or Townie, you might notice that\nthe LLMs are now set to prefer scoped blob storage, as the more future-proof,\nfaster alternative to global storage. If you're coding by hand (bless you, sweet\nthing) check out the\nnew documentation for the std/blob val for\ndetails on how to use scoped blob storage. It's the same API, just a different\nimport.",
"title": "Introducing Scoped Blob Storage"
}