Skip to content

Database Schema ​

The current schema version is 12. The canonical minimal script for a fresh PostgreSQL installation is:

text
scripts/postgresql/init.sql

See Deployment for the script download, checksum, and execution instructions.

Existing databases apply dialect-specific migrations. Core compatibility remains version 12; the 1.2.1 additive feature migration is v21.sql:

text
stores/jdbc/src/main/resources/com/firefly/store/jdbc/schema/migrations/h2/v21.sql
stores/jdbc/src/main/resources/com/firefly/store/jdbc/schema/migrations/postgresql/v21.sql
stores/jdbc/src/main/resources/com/firefly/store/jdbc/schema/migrations/mysql/v21.sql

Tables ​

TableResponsibility
firefly_schema_versionInstalled schema versions
firefly_cluster_metadataCluster invariants such as scheduler shard count
firefly_nodeServer node roles, registration, heartbeat, online state
firefly_shard_leaseScheduler shard ownership, lease, fencing token
firefly_executorLogical executor definitions
firefly_job_groupJob groups, default executor binding, metadata, enabled state
firefly_jobJob definitions, scheduling cursor, dispatch policy, shard id
firefly_executionParent execution attempt and aggregate status
firefly_execution_targetTarget execution records for unicast, broadcast, or shards
firefly_dispatch_outboxReliable dispatch queue, role routing, ACK timeout, retry state
firefly_executor_instance_locationGateway and session fencing for executor instances
firefly_audit_logAdmin change audit
firefly_job_historyJob create, enable/disable, and delete history
firefly_userAdmin users, PBKDF2 password digest, roles, first-login password state, and version
firefly_integration_keyPBKDF2 digest and rotation version of Integration Key
firefly_tenant_policyVersioned tenant weight, enablement, and five resource limits
firefly_tenant_usageAuthoritative concurrency, CPU, memory, backlog, and trigger-window usage
firefly_tenant_reservationIdempotent admission reservations and recovery leases
firefly_dispatch_fairness_stateDurable tenant virtual finish times and global fair clock
firefly_tenant_capacity_sampleFive-minute capacity buckets, version ranges, resource peaks, saturation, and rejections
firefly_tenant_capacity_flushIdempotency keys for source/bucket flushes

Initialization Modes ​

properties
firefly.jdbc.schema.mode=initialize-if-empty

For externally managed production migrations:

properties
firefly.jdbc.schema.mode=validate

initialize-if-empty checks the installed state and applies missing core and feature migrations in order. validate checks only and does not modify the database. Externally migrated databases must contain core schema version 12, with v20 tenant-governance tables and v21 capacity-sample tables installed. v21 only adds tables, so 1.2.0 and 1.2.1 can coexist during a rolling upgrade.

Released under the Apache-2.0 License.