Metadata-Driven Engine

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.

Domain Segregation
Strict xf_domain
Concurrency Lock
64-bit Ticks xf_ts
Managed Indexing
IXF_ / UXF_
Query Paradigm
Tokenized Index

1. System Architecture Topology

Click nodes for details
Initialisation & Security Boundary
xfInit • xfAuth
Multi-Domain • Salted SHA Token • RWLock Cache
Semantic Store
xfMetaData
Entity/Attribute Registry • Projections • Permissions
Execution Engine
xfCoreLib
Dynamic CRUD • Security Gates • Optimistic Locking
xfScript & ConfigDB
Auto-DDL • T_*, V_*
InstanceCtrl
Keys and Querying
CommandCenter
Data Provider Abstraction
xfDbOptimizer
IXF_/UXF_ Tuning • Defrag
Click on any node in the topology above to view its internal role, lock behavior, and database interaction.

2. Core Subsystems & Architectural Roles

Data Access 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.

Parameterized Command Pipeline
Security 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.

Domain Boundary: xf_domain
Semantic Metadata xfMetaData

Declarative Model Store

Maintains runtime catalogs of applications, entities, and attributes. Compiles projection views (ViewTableSQL) and row-level security scopes natively.

28+ Value Types Managed
Index Orchestration 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.

Fast Prefix Token Search
Schema Sync xfScript

Zero-Migration Auto-DDL

Automatically provisions base tables (T_*), adjusts columns, enforces primary keys, and prunes orphaned columns in the active database.

Automated Column Pruning
Automated Tuning xfDbOptimizer

Dynamic Index & Defrag

Provisions IXF_ covering natural-key indices. Continuously evaluates physical storage fragmentation to perform runtime index reindexing or maintenance.

Prefixes: IXF_ and UXF_

3. SaveInstance Execution Lifecycle Pipeline

10-Stage Deterministic Workflow
1
Validation Gate Check
SQL Expression

Executes parameterized database security gate. Aborts save and throws an exception if expression evaluates to false.

2
Aggregate Projection
Config Redirect

If target is a declarative aggregate entity, maps submitted non-framework keys back into the underlying base entity.

3
Pre-Save Interceptor
Run Algo

Fires dynamic business rule interceptors with xf_z = 1 prior to persistence checks.

4
Schema Constraints
is_unique

Validates nullability constraints, date invariants, and runs inline declarative validation rules.

5
Type Formatting
Pipeline

Formats temporal values, enforces field lengths, resolves foreign reference identifiers, and increments sequences.

6
Search Token Generation
xf_key • xf_qry_id

Assembles natural key identifiers and pipe-delimited search tokens from configured attributes.

7
Concurrency Verify
Ticks

For updates, appends AND [xf_ts] = @ts to predicate to catch collisions.

8
Atomic DML Execution
OUTPUT inserted.xf_id

Executes parameterized statements via CommandCenter, obtaining generated identity outputs atomically.

9
Index Synchronization
UPSERT Registry

Updates the universal index cache with newly persisted natural strings and query search tokens.

10
Instance Audit Logging
Inbuilt Log

Persists user action code (9 = Create, 1 = Update) into the central audit storage log.

4. Architectural Benefits

Zero-Code Persistence & Auto-DDL

Entities and properties added to metadata automatically generate physical tables, projection views (V_[OBJECT]), modified columns, and filtered indices without manual migration scripts.

Transparent Multi-Tenancy

Every business record, view, index, and query automatically incorporates xf_domain isolation in storage, projection, and unique constraints.

Decoupled Fast Lookups & Prefix Search

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.

Non-Blocking Framework Indexing

Autonomous index maintenance restricts defragmentation and tuning solely to framework-managed indices prefixed with IXF_ and UXF_, leaving custom DBA indices untouched.

Appendix

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 Graph
xfInit / xfAuth
Multi-Domain • RBAC • Salted Token
xfMetaData
Declarative Catalog • Routing
xfCoreLib
Dynamic CRUD • Concurrency
xfScript / ConfigDB
T_*, V_*, UXF_
InstanceCtrl
Index Registry
CommandCenter
Data Provider / DML
zxfAlgo
Rule Gateway

2. 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 Logic
Client Payload Dictionary D
Security Gate
deny_set Validation Expression
Fail Pass
Resolution
Aggregate Resolver
Abort Save
Throw Unauthorized
Interceptor Pipeline: zxfAlgo
Business rules with xf_z = 1
Schema & Rule Validator
Nullability, Dates, and is_unique
Auto-Formatting & Sequences
Type conversions & auto-increment
Token Assembler
xf_key • xf_qry_id
Optimistic Concurrency Gate
WHERE [xf_ts] = @ts (64-bit)
CommandCenter DML Execution
OUTPUT inserted.xf_id
Surrogate Index Synchronization
UPSERT natural keys & query tokens
Operational Audit Logging
Persist user action code in log table

4. 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_domain isolation 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.