Self-Describing Runtime Interpreter &
Autonomous DDL Pipeline
The xf Core Engine compiles declarative metadata into physical database structures, parameterized DML pipelines, granular security validation gates, and optimized high-performance indices on the fly without manual migrations.
xf_domain
xf_ts
IXF_ / UXF_
1. System Architecture Topology
Click nodes for details2. Core Subsystems & Architectural Roles
CommandCenter
Database Provider Abstraction
Thread-safe provider gateway instantiated via lazy initialization. Enforces automatic transaction rollback envelopes for non-query commands and yields streaming forward-only data readers.
xfAuth
Tenant & Token Auth Cache
High-throughput reader-writer lock cache. Validates sessions against UTC epoch minute offsets and verifies salted SHA-256 password digests across tenant spaces.
xfMetaData
Declarative Model Store
Maintains runtime catalogs of applications, entities, and attributes. Compiles projection views (ViewTableSQL) and row-level security scopes natively.
InstanceCtrl
Surrogate Search Index
Powers In-Memory Registry to eliminate expensive relational joins. Indexes composite natural keys and multi-token query strings for fast retrieval.
xfScript
Zero-Migration Auto-DDL
Automatically provisions base tables (T_*), adjusts columns, enforces primary keys, and prunes orphaned columns in the active database.
xfDbOptimizer
Dynamic Index & Defrag
Provisions IXF_ covering natural-key indices. Continuously evaluates physical storage fragmentation to perform runtime index reindexing or maintenance.
3. SaveInstance Execution Lifecycle Pipeline
10-Stage Deterministic WorkflowSQL Expression
Executes parameterized database security gate. Aborts save and throws an exception if expression evaluates to false.
Config Redirect
If target is a declarative aggregate entity, maps submitted non-framework keys back into the underlying base entity.
Run Algo
Fires dynamic business rule interceptors with xf_z = 1 prior to persistence checks.
is_unique
Validates nullability constraints, date invariants, and runs inline declarative validation rules.
Pipeline
Formats temporal values, enforces field lengths, resolves foreign reference identifiers, and increments sequences.
xf_key • xf_qry_id
Assembles natural key identifiers and pipe-delimited search tokens from configured attributes.
Ticks
For updates, appends AND [xf_ts] = @ts to predicate to catch collisions.
OUTPUT inserted.xf_id
Executes parameterized statements via CommandCenter, obtaining generated identity outputs atomically.
UPSERT Registry
Updates the universal index cache with newly persisted natural strings and query search tokens.
Inbuilt Log
Persists user action code (9 = Create, 1 = Update) into the central audit storage log.
4. Architectural Benefits
Entities and properties added to metadata automatically generate physical tables, projection views (V_[OBJECT]), modified columns, and filtered indices without manual migration scripts.
Every business record, view, index, and query automatically incorporates xf_domain isolation in storage, projection, and unique constraints.
Heavy multi-table joins are decoupled during search by pre-tokenizing and caching natural labels (str_id) and tokens into an index for fast paged searches.
Autonomous index maintenance restricts defragmentation and tuning solely to framework-managed indices prefixed with IXF_ and UXF_, leaving custom DBA indices untouched.
Architecture & Execution Manifest
The following section constitutes the technical specification of the xf Core Engine pattern: a declarative, metadata-driven runtime interpreter, schema generator, and autonomous DDL synchronization platform designed to decouple business models from underlying physical databases.
1. System Topology Specification
Pure SVG Bézier Graph2. Core Subsystem Responsibilities
| Layer | Component | Core Responsibilities |
|---|---|---|
| Data Access | CommandCenter |
Thread-safe connection provider; encapsulates database abstraction drivers; enforces atomic rollback envelopes; manages forward data streaming and hydration. |
| Identity & Security | xfAuth |
Enforces multi-tenant boundaries (xf_domain); thread-safe caching; validates sessions via salted SHA-256 tokens; evaluates role-based access controls and origin boundaries. |
| Metadata Engine | xfMetaData |
Central catalog for apps, entities, and attributes; compiles dynamic projection views; resolves fine-grained CRUD permissions and row selection filters. |
| Runtime Engine | xfCoreLib |
Executes unified instance lifecycles; runs security gates; manages sequences; builds search tokens; applies optimistic locking via high-resolution ticks. |
| Search & Index | InstanceCtrl |
Surrogate lookup registry (In-Memory Registry); maintains natural keys, multi-token phrases, and usage rankings to bypass multi-table joins. |
| Auto-DDL | xfScript |
Introspects catalog definitions; automatically alters dynamic base tables and views; prunes obsolete columns; ensures primary key integrity. |
| Autonomous Index | xfDbOptimizer |
Generates dedicated natural key and foreign key indexes; executes automated fragmentation assessment and optimization. |
3. Pipeline Flowchart
Bézier Branching Logic4. Architectural Highlights Summary
- Zero-Migration Runtime DDL: Updating metadata definitions instantly synchronizes tables and recreates projection views without manual migration scripts.
- Strict Multi-Tenancy by Design: Base tables and indices inherently enforce
xf_domainisolation across all operations. - Decoupled Fast Search: Bypasses relational query joins by tokenizing display strings ahead of time for indexed prefix matching (
w_start_%). - Microsecond-Scale Optimistic Locking: Prevents concurrency conflicts using uniform 64-bit timestamp ticks.
- Framework-Tagged Index Management: Autonomously manages and tunes framework indexes (
IXF_ / UXF_) without conflicting with custom DBA configurations.