{"id":35240872,"url":"https://github.com/fastly/compute-starter-kit-rust-kv-store","last_synced_at":"2026-04-09T03:31:27.944Z","repository":{"id":66166737,"uuid":"589977819","full_name":"fastly/compute-starter-kit-rust-kv-store","owner":"fastly","description":"Starter kit demonstrating how to use the Fastly KV store from within a Rust-based Fastly compute project.","archived":false,"fork":false,"pushed_at":"2025-11-04T11:24:04.000Z","size":29,"stargazers_count":1,"open_issues_count":0,"forks_count":3,"subscribers_count":18,"default_branch":"main","last_synced_at":"2026-04-04T01:42:41.654Z","etag":null,"topics":["compute-starter","fastly-oss-tier1"],"latest_commit_sha":null,"homepage":"https://developer.fastly.com/solutions/starters/","language":"Rust","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fastly.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-01-17T11:41:07.000Z","updated_at":"2025-11-04T11:24:06.000Z","dependencies_parsed_at":null,"dependency_job_id":"f6ae2cf9-03a2-4bae-a6e0-a6c383bc0756","html_url":"https://github.com/fastly/compute-starter-kit-rust-kv-store","commit_stats":null,"previous_names":["fastly/compute-starter-kit-rust-kv-store"],"tags_count":0,"template":true,"template_full_name":null,"purl":"pkg:github/fastly/compute-starter-kit-rust-kv-store","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fastly%2Fcompute-starter-kit-rust-kv-store","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fastly%2Fcompute-starter-kit-rust-kv-store/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fastly%2Fcompute-starter-kit-rust-kv-store/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fastly%2Fcompute-starter-kit-rust-kv-store/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fastly","download_url":"https://codeload.github.com/fastly/compute-starter-kit-rust-kv-store/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fastly%2Fcompute-starter-kit-rust-kv-store/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31581996,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-08T14:31:17.711Z","status":"online","status_checked_at":"2026-04-09T02:00:06.848Z","response_time":112,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["compute-starter","fastly-oss-tier1"],"created_at":"2025-12-30T05:01:02.852Z","updated_at":"2026-04-09T03:31:27.932Z","avatar_url":"https://github.com/fastly.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Compute Starter Kit Rust KV Store\n\nFastly KV Store is a globally consistent key-value storage accessible across the Fastly Network. This makes it possible for your Compute@Edge application to read and write from KV-stores. The application shows how to use Fastly KV Store within a Rust Compute@Edge application.\n\n**For more details about other starter kits for Compute@Edge, see the [Fastly developer hub](https://developer.fastly.com/solutions/starters)**\n\n## Understanding the code\n\n### [./src/main.rs](./src/main.rs)\n\nA single main function is defined which uses the [`#[fastly::main]` macro](https://docs.rs/fastly/latest/fastly/attr.main.html), this is the function that recieves the incoming `Request` and returns a `Result\u003cResponse\u003e`, which will be sent to the user-agent.\n\n## Deploying the project to Fastly\n\nNote that Fastly Services have to have unique names within a Fastly Account.\n\nTo create and deploy to a new Fastly Service run the command and follow the instructions:\n\n```shell\nfastly compute publish\n```\n\n## Creating and attaching the KV Store\n\nThis project makes use of a resource called a KV Store, and this starter kit takes care of a few prerequisites for you:\n- creating a KV Store\n- linking the KV store to your service upon deployment\n- creating a mock-up of a KV Store that your service may access when running locally via `fastly compute serve`\n\nThese tasks are handled using the `[setup]` and `[local_server]` sections of the [fastly.toml](https://www.fastly.com/documentation/reference/compute/fastly-toml/) file included with this starter kit.\n\nIn general, when using KV Stores, you'll need to take care of these things. The Fastly CLI and UI provide interfaces for these activities.\n\n```shell\nfastly kv-store create --name=\"my-store\"\n```\n\nKV Stores are accessible by multiple Fastly services (this is part of the power of KV Stores!). You need to grant access to your KV Store to your service. To do this, you need to know your Service ID and your KV Store ID. To get the KV Store ID, use the kv-store subcommand.\n\n```shell\nfastly kv-store list\n```\n\nThen, link the KV Store to a new clone of your service, using the KV Store ID and Service ID, and activate the new version.\n\n```shell\nfastly resource-link create --resource-id=RESOURCE-ID --service-id=SERVICE-ID --version=latest --autoclone\nfastly service-version activate --version=latest --service-id=SERVICE-ID\n```\n\nThat is it, we now have a Fastly Service, a Fastly KV Store and have them linked together!\n\nYou can view real-time logs for the Fastly Service by running:\n```shell\nfastly log-tail\n```\n\n## Adding entries to the KV Store\n\nIt is possible to add key-value pairs to an KV Store using the Fastly CLI like so:\n```shell\nfastly kv-store-entry create --store-id=$FASTLY_KV_STORE_ID --key-name=$KEY --value=$VALUE\n```\n\nFor example, here is how you could add to the KV Store named `my-store` a key named `readme` whose value is the contents of `README.md`:\n```shell\nfastly kv-store-entry create --store-id=\"$(fastly kv-store list --json | jq -r '.Data[]|select(.Name==\"my-store\").ID')\" --key-name=\"readme\" --value=\"$(cat README.md)\"\n```\n\n## Security issues\n\nPlease see our [SECURITY.md](SECURITY.md) for guidance on reporting security-related issues.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffastly%2Fcompute-starter-kit-rust-kv-store","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffastly%2Fcompute-starter-kit-rust-kv-store","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffastly%2Fcompute-starter-kit-rust-kv-store/lists"}