A key-value store associates unique keys with values for direct lookup. Its interface is deliberately small: put data into the store and get it back by key. In a task datastore, a UUID can identify the task stored as its value. section 11.8
For an orchestrator, the store holds data needed by the manager and workers. An embedded key-value store places the datastore library inside the application, avoiding a separately managed database server and network calls for reads and writes. This provides fast, simple access while keeping the system focused on Docker containers. section 1.7 section 11.8
The model becomes concrete through these implementation choices:
- Use an in-memory Go map as the simplest form of key-value storage. section 11.8
- Replace transient storage with BoltDB when task and event data must persist. section 11.8
- Choose the key-value model instead of a relational datastore when strict tables, columns, and SQL are unnecessary. section 11.8
Persisting an orchestrator task
A task enters the store under its UUID. The manager or worker later retrieves that task using the same key. The in-memory map demonstrates the interaction first; BoltDB preserves the same key/value paradigm in an embedded persistent datastore. section 11.8
$ go get github.com/boltdb/bolt/...
Install the BoltDB library before implementing persistent task and event stores. section 11.8







