Stores
Stores are the fourth component type in walkerOS, alongside sources, transformers, and destinations. They provide passive key-value storage that other components consume, with no event chains and no push functions.
The Store interface
Every store implements four operations:
Stores can be synchronous or asynchronous. The interface supports both.
Available implementations
| Package | Environment | Storage | Features |
|---|---|---|---|
@walkeros/server-store-fs | Node.js | Filesystem | Read/write files, directory listing |
@walkeros/server-store-s3 | Node.js | S3-compatible | Object storage via AWS SDK |
@walkeros/server-store-gcs | Node.js | Google Cloud Storage | Object storage via GCS JSON API |
@walkeros/server-store-sheets | Node.js | Google Sheets | Row-per-key storage via Sheets API |
The collector ships a built-in in-memory cache tier (__cache). Wire it on any store via Flow.Store.cache instead of declaring a separate memory store.
Configuration
Bundled mode (flow.json)
Define stores in the stores section of a flow config. Use cache to enable the built-in in-memory cache tier on top of the backing store:
Integrated mode (TypeScript)
Connecting stores to components
Use the $store. prefix in a component's env to inject a store instance at runtime:
The bundler resolves $store.cache to the initialized store instance. Invalid references (pointing to undefined stores) are caught at build time.
Lifecycle
Stores follow a strict lifecycle relative to other components:
- Stores initialize first: before sources, transformers, and destinations
- Stores destroy last: after all other components have shut down
This guarantees stores are available when any component starts and remain available while they gracefully shut down.
Setup lifecycle (optional)
Stores may also implement an optional setup() lifecycle for one-time, operator-time provisioning, for example creating SQLite tables or an S3 bucket. Setup runs only when an operator explicitly invokes walkeros setup store.<name>; the runtime never auto-invokes it. Opt in via config.setup in the flow config (true or an object).
See Setup lifecycle on the destinations page for the full concept, and walkeros setup CLI command for the operator-facing command.
Next steps
- Flow configuration - Stores in flow.json
- File transformer - Serve files from a store
- Event cache - Response caching with stores
- Docker: Including files - Bake store data into Docker images