Task & Config Stores
a2a-rust uses pluggable storage backends for tasks and push notification configs. The built-in in-memory stores work for development and testing. For production, use the SQLite or PostgreSQL stores that ship with the crate (features sqlite / postgres), or implement the traits for your own database.
Which store
| Store | Use it for |
|---|---|
InMemoryTaskStore, the default | Development, tests, and one process whose tasks need not survive a restart. Terminal tasks expire after an hour. |
SqliteTaskStore, feature sqlite | One process, or processes on one host sharing the file, whose tasks must survive restarts. Tasks stay until you delete them. |
PostgresTaskStore, feature postgres | Replicas on several hosts sharing one store. Tasks stay until you delete them. |
TenantAware… variants | Multi-tenant servers, and any server behind an authenticating interceptor: one partition per tenant, and per caller. |
| Your own | A database the SDK does not ship a store for. |
Push-notification configs have their own store with the same choices; see Push-config stores.
In this chapter
- In-memory task store: limits, eviction and
TaskStoreConfig. - SQLite task store and PostgreSQL task store: setup, migrations, the connection pool, and what happens when the database is briefly unavailable.
- Tenant-aware stores: partitions per tenant and per caller, and why an authenticating interceptor needs them.
- Push-config stores: the
PushConfigStoretrait and the in-memory store. - Implementing a store: the
TaskStoretrait, errors, pagination and concurrency. - Retention, erasure and audit: purging old tasks and erasing a caller's data.
- Stores shared by replicas: terminal states, log positions and turn claims.
Next steps
- Production Hardening — Deployment checklist
- Configuration Reference — Every builder and store default