drift Docs
Start
What is Drift?
The tour, if you are new here.
Why Drift?
The case for a smaller cloud.
Getting started
Nothing to deployed, in one command.
Architecture
How a slice is put together.
What it costs
The free grant, five unit prices, two rules.
Build
Canvas
Static sites, same origin as your API.
Tools
Operate
Auth
Accounts, tokens and scopes.
Security
Boundaries, sandboxing and hardening.

Backbone Cache

A key/value store with an optional TTL in seconds (0 = no expiry):

Go
drift.Backbone.Cache.Set("session:abc", token, 3600)
drift.Backbone.Cache.Set("hits", strconv.Itoa(42), 60)   // serialize non-strings yourself
v, _ := drift.Backbone.Cache.Get("session:abc")

The value must be a string.

The SDKs accept any type, but the slice deserializes value as a JSON string, so Cache.Set("hits", 42, 60) answers 400 key and value required, naming the wrong problem, since both were present. An empty string is rejected the same way. Serialize numbers, maps and structs before you call.

Capacity

The cache is capped independently of your tier: 1 MiB per value, 10,000 entries, and 64 MiB of total value bytes. Crossing any of the three fails the set with 429 and a message naming which one. Overwriting a key reclaims its old bytes first, and only a new key counts against the entry cap.

Shell
drift backbone cache set    greeting "hello" --ttl 3600
drift backbone cache get    greeting
drift backbone cache exists greeting
drift backbone cache del    greeting

Cache is for speed, not durability.

Treat it as data you can always recompute. For anything you can't lose, use NoSQL, SQL, or Blobs.