When to use it
The default is right for trying things out: nothing to set up, and a restart gives a clean server. Choose files when you run a single server and want sessions, workflows and run history to survive a restart. Choose PostgreSQL when you need the same on a database, want several servers to share state, or want high availability.The three profiles
Which setting switches which store
The PostgreSQL stores are created only when
yukta.session.store-type=postgres. The postgres profile sets it. The other PostgreSQL switches (yukta.restart.store-type, yukta.kv.store-type, yukta.session-memory.store-type, yukta.ha.mode) then choose which further data moves to the database.
What survives a restart
“Memory” is the default. “File” means the directory settings are set and the session store isfile. “PostgreSQL” assumes the matching switch from the table above is set for each row.
A deployment can be half durable. A PostgreSQL log with in-memory checkpoints keeps the run history but has no outputs to resume from. Set every switch you need.
File layout
The file store writes plain files and JSON lines under directories you choose. It is meant for one server; do not share these directories between servers.
File writes for definitions are atomic. The execution log is written by one background writer, so requests never wait on the disk.
PostgreSQL
1
Build with the PostgreSQL switch
The PostgreSQL stores are an optional part of the build. Add the switch when you build:
2
Activate the profile
Name the The profile sets
postgres profile together with prod:yukta.session.store-type=postgres and turns on the database support. Without the profile the database support stays off.3
Give two connection URLs
The server needs two URLs to the same database, because migrations and run-time access use different connections:
Credentials:
spring.r2dbc.username and spring.r2dbc.password for run-time access, spring.flyway.user and spring.flyway.password for migrations. As environment variables these are SPRING_R2DBC_URL, SPRING_R2DBC_USERNAME, SPRING_R2DBC_PASSWORD, SPRING_FLYWAY_URL, SPRING_FLYWAY_USER and SPRING_FLYWAY_PASSWORD.4
Choose the further stores
Move the data you need:
yukta.restart.store-type=postgres for checkpoints, yukta.kv.store-type=postgres for KV_STORE state, yukta.session-memory.store-type=postgres for chat history, yukta.ha.mode=postgres for the leader lease.Schema tables
Six numbered migrations create nine tables.
Each statement is committed on its own. Nothing in the module relies on a transaction across several statements.
Retention and trimming
The PostgreSQL execution log queues up to 10,000 events for its writer and inserts them in batches of 100. If the queue is full, events are dropped and an error is logged.