Databricks LTAP, Lakebase, and Lakehouse Real-Time for Institutional Trading-Robot Data Operations
Speaker background
The speaker moved from a music production house and live-brand keyboard performance into a proprietary-firm DevOps and field-engineering team-lead role responsible for setting up on-site trading robots.
Live music and on-site trading infrastructure share an operational discipline. A keyboard player must control timing, signal routing, latency, synchronization, monitoring, fallback equipment, and the difference between the studio arrangement and the live venue. A trading-robot field engineer must control clock synchronization, network routes, market-data inputs, order state, database transactions, failover, observability, and the difference between a research environment and an execution environment.
A live performance cannot stop because one sound module becomes unavailable. A trading operation cannot lose the authoritative state of an order, risk limit, strategy session, or operator intervention because one application process restarts.
This guide creates a Databricks Free Edition prototype for an institutional-grade data solution supporting on-site trading-robot operations. It uses Lakebase Postgres for low-latency operational transactions, Lakebase integrations for governed synchronization, Unity Catalog for governance, Delta Lake for durable analytical history, and Lakehouse//RT for low-latency, high-concurrency analytics where the Beta capability is available.
Important trading boundary
Databricks Free Edition is a perpetual, no-cost, serverless-only cloud environment for learning and prototyping. It is quota-limited and does not provide a production service-level agreement.
Use synthetic robot sessions, orders, fills, limits, health checks, operator actions, network events, and market observations. Do not connect Free Edition to a live exchange gateway, broker session, production FIX engine, order-management system, market-data feed, hardware kill switch, client account, or real trading credential.
Lakebase can store application and workflow state, but the prototype must not become the sole production record for an order or the sole enforcement point for a pre-trade risk limit.
Keep deterministic order validation, credit controls, throttling, duplicate-order prevention, mass cancellation, exchange session management, and kill switches in the approved trading and risk-control infrastructure.
Databricks should provide governed data integration, investigation, monitoring, application state, audit history, analytical features, dashboards, and AI-assisted operations. Every consequential production action must use an independently authorized interface and return a confirmation from the external system.
Correct understanding of LTAP
Lake Transactional and Analytical Processing, or LTAP, unifies operational and analytical data around object storage and common governance while allowing each workload to use a suitable engine.
Lakebase Postgres provides a PostgreSQL-compatible transactional interface for application workloads. The Lakebase storage architecture separates compute from durable storage. Compute nodes are stateless query engines, while data is durably stored through a distributed storage layer backed by cloud object storage.
The LTAP architecture reduces the need to build and operate traditional external CDC infrastructure between the operational database and lakehouse. Lakebase uses managed integrations to make operational changes available as Delta data and to serve selected lakehouse data through PostgreSQL.
Do not state that all operational rows are synchronously and automatically transformed into Delta Lake or Apache Iceberg during every normal PostgreSQL disk write. The supported integration is explicit: Lakebase Change Data Feed stores row-level PostgreSQL changes as Unity Catalog Delta tables, while synced tables move selected Unity Catalog data into Lakebase for low-latency serving.
The platform removes much of the external pipeline engineering, polling, credentials, scheduling, retry logic, and duplicated governance. It does not remove all data movement, transformation, latency, monitoring, or consistency design.
Lakehouse Real-Time and the Reyden engine
Lakehouse//RT is a serverless analytical warehouse for low-latency, high-concurrency SQL reads against Unity Catalog tables using Delta Lake or Apache Iceberg formats in cloud storage.
The engine name is Reyden. It is not Rayden or Raiden.
Databricks describes Lakehouse//RT as suitable for operational analytics, application serving, BI dashboards, and observability. The Beta documentation targets sub-second reads for hundreds to thousands of concurrent users. Databricks has also published preview benchmark examples with response times as low as 10 milliseconds on smaller datasets and under 100 milliseconds on larger datasets, but those results are not performance guarantees for a trading use case.
Lakehouse//RT is a Beta feature requiring a supported region and workspace enablement. It cannot be assumed to exist in Free Edition.
Lakebase and Lakehouse//RT serve different workloads:
- Lakebase handles row-level transactions, application state, point reads, inserts, updates, and PostgreSQL-compatible workflows.
- Lakehouse//RT handles analytical SQL reads over open Delta and Iceberg tables at high concurrency.
Step 1: Define the institutional data solution
Separate the system into four data responsibilities.
Operational state includes robot sessions, operator commands, strategy parameters, deployment state, heartbeat status, incident cases, and requested control actions. Store this in Lakebase when available.
Authoritative trading state includes orders, executions, exchange acknowledgements, broker records, positions, and risk decisions. In production, retain the authoritative record in the approved OMS, EMS, FIX store, broker, exchange, and risk platforms. Replicate or synchronize appropriate records into Databricks for analysis.
Analytical history includes market observations, robot telemetry, execution quality, historical risk, incident timelines, and feature datasets. Store it in governed Delta or Iceberg tables.
Serving data includes current robot health, recent risk indicators, execution summaries, and incident state required by applications and dashboards. Serve point-oriented application state through Lakebase and high-concurrency analytical reads through Lakehouse//RT where available.
Step 2: Create the Databricks Free Edition workspace
Create a workspace named:
trading_robot_ltap_free_nonprod
Create these folders:
00_environment01_lakebase02_robot_telemetry03_order_and_execution_copies04_risk_and_limits05_ltap_integrations06_realtime_analytics07_databricks_app08_incident_operations09_governance
Create a notebook named 00_environment_check and run:
SELECT current_user() AS current_user, current_catalog() AS current_catalog, current_schema() AS current_schema, current_timestamp() AS checked_at; Record that the environment is synthetic, disconnected from all venues, and unsuitable for continuous production supervision.
Step 3: Define the trading-robot lifecycle
Use these lifecycle states:
REGISTEREDCONFIGUREDREADY_FOR_CHECKCHECK_FAILEDREADY_FOR_STARTRUNNING_SIMULATIONPAUSE_REQUESTEDPAUSEDSTOP_REQUESTEDSTOPPEDDEGRADEDINCIDENTRETIRED
The Free Edition prototype must never use a state that implies connection to a live market. Use RUNNING_SIMULATION, not LIVE.
Each state transition requires an actor, timestamp, previous state, requested state, reason, configuration version, and evidence.
A requested state must be stored separately from a confirmed state. This prevents the interface from claiming that a robot stopped merely because an operator clicked a button.
Step 4: Create the Unity Catalog analytical model
Create the catalog and schemas:
CREATE CATALOG IF NOT EXISTS robot_ops_lab; CREATE SCHEMA IF NOT EXISTS robot_ops_lab.raw; CREATE SCHEMA IF NOT EXISTS robot_ops_lab.silver; CREATE SCHEMA IF NOT EXISTS robot_ops_lab.gold; CREATE SCHEMA IF NOT EXISTS robot_ops_lab.reference; CREATE SCHEMA IF NOT EXISTS robot_ops_lab.governance; If catalog creation is unavailable, create the schemas in the default catalog.
Create a robot registry:
CREATE TABLE IF NOT EXISTS robot_ops_lab.reference.robot_registry ( robot_id STRING, robot_name STRING, strategy_id STRING, desk_id STRING, site_id STRING, host_id STRING, owner_group STRING, approved_version STRING, approved_mode STRING, status STRING, effective_from TIMESTAMP, effective_to TIMESTAMP, is_synthetic BOOLEAN ) USING DELTA; Create a strategy-limit table:
CREATE TABLE IF NOT EXISTS robot_ops_lab.governance.strategy_limits ( strategy_id STRING, max_order_notional DECIMAL(24,2), max_position_notional DECIMAL(24,2), max_orders_per_second INT, max_daily_loss DECIMAL(24,2), max_market_data_age_ms BIGINT, max_clock_skew_ms BIGINT, approved_by STRING, effective_from TIMESTAMP, effective_to TIMESTAMP, is_synthetic BOOLEAN ) USING DELTA; Step 5: Create the synthetic telemetry model
Create a raw telemetry table:
CREATE TABLE IF NOT EXISTS robot_ops_lab.raw.robot_telemetry ( event_id STRING, event_time TIMESTAMP, received_time TIMESTAMP, robot_id STRING, site_id STRING, host_id STRING, process_id STRING, event_type STRING, cpu_pct DECIMAL(8,4), memory_pct DECIMAL(8,4), network_latency_ms DECIMAL(12,4), clock_skew_ms DECIMAL(12,4), market_data_age_ms BIGINT, order_rate_per_second INT, error_code STRING, payload VARIANT, source_system STRING, is_synthetic BOOLEAN, ingested_at TIMESTAMP ) USING DELTA; Use event types such as:
HEARTBEATPROCESS_STARTPROCESS_STOPMARKET_DATA_STATUSORDER_GATEWAY_STATUSRISK_GATEWAY_STATUSCLOCK_STATUSNETWORK_STATUSCONFIGURATION_LOADERROR
Generate synthetic events at one-second intervals for learning. Do not claim that a one-second prototype satisfies production trading latency.
Step 6: Create synthetic order and execution copies
Create analytical order events:
CREATE TABLE IF NOT EXISTS robot_ops_lab.raw.order_events ( event_id STRING, event_time TIMESTAMP, robot_id STRING, strategy_id STRING, order_id STRING, client_order_id STRING, instrument_id STRING, side STRING, order_type STRING, quantity DECIMAL(24,8), price DECIMAL(24,10), order_status STRING, external_sequence BIGINT, source_system STRING, is_synthetic BOOLEAN, ingested_at TIMESTAMP ) USING DELTA; Create analytical execution events:
CREATE TABLE IF NOT EXISTS robot_ops_lab.raw.execution_events ( execution_id STRING, order_id STRING, execution_time TIMESTAMP, robot_id STRING, strategy_id STRING, instrument_id STRING, side STRING, executed_quantity DECIMAL(24,8), executed_price DECIMAL(24,10), external_reference STRING, source_system STRING, is_synthetic BOOLEAN, ingested_at TIMESTAMP ) USING DELTA; These Delta tables are analytical copies in the prototype. They are not the production book of record.
Step 7: Create a Lakebase project
Open the app switcher and select Lakebase Postgres.
If Lakebase is unavailable in the workspace, retain the Delta-only prototype and treat this step as a paid-workspace extension.
Select Autoscaling and create a project named:
trading-robot-operations-nonprod
Create a production branch for the synthetic operational application.
Use the browser SQL editor or a PostgreSQL client to create an application schema:
CREATE SCHEMA IF NOT EXISTS robot_ops; Create robot sessions:
CREATE TABLE IF NOT EXISTS robot_ops.robot_session ( session_id UUID PRIMARY KEY, robot_id TEXT NOT NULL, strategy_id TEXT NOT NULL, site_id TEXT NOT NULL, configuration_version TEXT NOT NULL, requested_state TEXT NOT NULL, confirmed_state TEXT NOT NULL, requested_by TEXT NOT NULL, requested_at TIMESTAMPTZ NOT NULL DEFAULT NOW(), confirmed_at TIMESTAMPTZ, external_confirmation_id TEXT, simulation_only BOOLEAN NOT NULL DEFAULT TRUE ); Create operator actions:
CREATE TABLE IF NOT EXISTS robot_ops.operator_action ( action_id UUID PRIMARY KEY, session_id UUID REFERENCES robot_ops.robot_session(session_id), action_type TEXT NOT NULL, action_reason TEXT NOT NULL, requested_by TEXT NOT NULL, requested_at TIMESTAMPTZ NOT NULL DEFAULT NOW(), approval_status TEXT NOT NULL, approved_by TEXT, approved_at TIMESTAMPTZ, external_confirmation_id TEXT, confirmed_state TEXT ); Create incident cases:
CREATE TABLE IF NOT EXISTS robot_ops.incident_case ( incident_id UUID PRIMARY KEY, robot_id TEXT NOT NULL, severity TEXT NOT NULL, incident_type TEXT NOT NULL, opened_at TIMESTAMPTZ NOT NULL DEFAULT NOW(), opened_by TEXT NOT NULL, current_owner TEXT, incident_status TEXT NOT NULL, summary TEXT NOT NULL, closed_at TIMESTAMPTZ ); Step 8: Add PostgreSQL constraints and indexes
Add state constraints:
ALTER TABLE robot_ops.robot_session ADD CONSTRAINT valid_requested_state CHECK ( requested_state IN ( 'REGISTERED', 'CONFIGURED', 'READY_FOR_CHECK', 'CHECK_FAILED', 'READY_FOR_START', 'RUNNING_SIMULATION', 'PAUSE_REQUESTED', 'PAUSED', 'STOP_REQUESTED', 'STOPPED', 'DEGRADED', 'INCIDENT', 'RETIRED' ) ); Create indexes:
CREATE INDEX IF NOT EXISTS idx_robot_session_state ON robot_ops.robot_session(robot_id, confirmed_state, requested_at DESC); CREATE INDEX IF NOT EXISTS idx_operator_action_session ON robot_ops.operator_action(session_id, requested_at DESC); CREATE INDEX IF NOT EXISTS idx_incident_open ON robot_ops.incident_case(incident_status, severity, opened_at DESC); Use PostgreSQL transactions for related operational changes. For example, create an incident and a stop request in one transaction so the operational record does not contain only half the workflow.
Step 9: Connect an existing application using PostgreSQL
Obtain the Lakebase connection details from the Connect page.
Use a standard PostgreSQL driver in an application. Example Python code:
import os import psycopg connection = psycopg.connect( host=os.environ["LAKEBASE_HOST"], dbname=os.environ["LAKEBASE_DATABASE"], user=os.environ["LAKEBASE_USER"], password=os.environ["LAKEBASE_PASSWORD"], sslmode="require", ) with connection: with connection.cursor() as cursor: cursor.execute( """ SELECT robot_id, confirmed_state, requested_at FROM robot_ops.robot_session WHERE robot_id = %s ORDER BY requested_at DESC LIMIT 1 """, ("SIM_ROBOT_001",), ) print(cursor.fetchone()) Store credentials through the approved Databricks App resource or secret pattern. Never place them in source code or a Git repository.
PostgreSQL compatibility allows existing applications and frameworks to connect without adopting a proprietary database API. Compatibility does not mean every PostgreSQL extension or administrative operation is supported. Verify required extensions and behavior.
Step 10: Understand storage and compute separation
Lakebase compute endpoints execute PostgreSQL queries but do not carry the only durable copy of the data.
The distributed storage layer persists the database state using cloud object storage. This separation allows compute to scale independently and scale to zero under supported settings.
Scale to zero is useful for a development or intermittent operations application. It introduces a resume interval after inactivity. Do not place a production emergency-control path behind a database that may be scaled to zero.
For production, select compute, high availability, and regional disaster-recovery settings according to the required recovery-time objective and recovery-point objective.
Do not describe object storage as receiving ordinary application-visible Delta or Iceberg rows synchronously from every PostgreSQL commit. Lakebase's internal storage format and the lakehouse integration interface are separate concerns.
Step 11: Register Lakebase in Unity Catalog
Where supported, register the Lakebase database in Unity Catalog.
This enables common discovery, governance, and cross-source analysis of Lakebase metadata.
Grant only the required users and service principals access.
Use the registration to help analysts find operational datasets and join them with governed lakehouse data. Do not expose database-administration privileges through broad catalog grants.
Document the system of record for every field. A Unity Catalog registration does not change ownership of the operational record.
Step 12: Feed Lakebase changes into Delta tables
Use Lakebase Change Data Feed to store row-level changes from selected PostgreSQL tables as Unity Catalog Delta tables.
Select these operational tables for the prototype:
robot_ops.robot_sessionrobot_ops.operator_actionrobot_ops.incident_case
Create destinations such as:
robot_ops_lab.raw.lakebase_robot_session_cdfrobot_ops_lab.raw.lakebase_operator_action_cdfrobot_ops_lab.raw.lakebase_incident_case_cdf
Preserve source primary key, operation type, source commit order, source commit time, and ingestion time.
Use the Delta change history for:
- Audit timelines.
- Incident reconstruction.
- Operator-action analytics.
- State-transition analysis.
- SLA measurement.
- Investigation of unauthorized or unusual changes.
This managed integration reduces reliance on an external CDC service and polling job. It is still an asynchronous data-integration path and must be monitored for freshness, failure, schema change, and replay behavior.
Step 13: Serve lakehouse data into Lakebase
Use synced tables to copy selected Unity Catalog data into Lakebase for low-latency PostgreSQL reads.
Good candidates include:
- Approved robot configuration.
- Current strategy limits.
- Current instrument reference data.
- Current simulation health summary.
- Recent approved incident classification.
Do not sync the entire raw telemetry or historical order-event dataset into PostgreSQL. Keep large analytical history in Delta or Iceberg.
Create a compact current-state view:
CREATE OR REPLACE VIEW robot_ops_lab.gold.current_robot_health AS WITH ranked AS ( SELECT *, ROW_NUMBER() OVER ( PARTITION BY robot_id ORDER BY event_time DESC, received_time DESC ) AS row_number FROM robot_ops_lab.raw.robot_telemetry ) SELECT robot_id, site_id, host_id, event_time, cpu_pct, memory_pct, network_latency_ms, clock_skew_ms, market_data_age_ms, order_rate_per_second, error_code, is_synthetic FROM ranked WHERE row_number = 1; Sync this compact result only if the application needs PostgreSQL point reads. Lakehouse//RT may be a better choice for high-concurrency analytical reads in an eligible workspace.
Step 14: Define consistency and latency expectations
Use Lakebase transactions when an application needs immediate transactional consistency within PostgreSQL.
Treat Lakebase Change Data Feed and synced tables as managed integration paths with measurable lag. Do not assume zero latency.
Record these timestamps:
- Application commit time.
- Lakebase source commit time.
- Change-feed availability time.
- Delta ingestion time.
- Analytical transformation time.
- Lakehouse//RT query time.
- Application display time.
Calculate operational-to-analytical lag:
analytical_lag_ms = delta_ingestion_time - lakebase_source_commit_time
Calculate end-to-end display lag:
display_lag_ms = application_display_time - application_commit_time
Define a prototype freshness target, such as 30 seconds for workflow analytics. This target is not suitable for pre-trade risk or exchange control.
Step 15: Build robot-health analytics
Create a health-status view:
CREATE OR REPLACE VIEW robot_ops_lab.gold.robot_health_status AS SELECT robot_id, site_id, host_id, event_time, cpu_pct, memory_pct, network_latency_ms, clock_skew_ms, market_data_age_ms, order_rate_per_second, error_code, CASE WHEN error_code IS NOT NULL THEN 'INCIDENT' WHEN market_data_age_ms > 1000 THEN 'DEGRADED_MARKET_DATA' WHEN clock_skew_ms > 50 THEN 'CLOCK_WARNING' WHEN network_latency_ms > 100 THEN 'NETWORK_WARNING' WHEN cpu_pct > 90 OR memory_pct > 90 THEN 'RESOURCE_WARNING' ELSE 'HEALTHY' END AS health_status, is_synthetic FROM robot_ops_lab.gold.current_robot_health; The thresholds are synthetic examples. Production limits depend on strategy, venue, network architecture, clock source, market-data contract, and risk requirements.
A high-frequency strategy may require microsecond or low-millisecond controls outside Databricks. A slower execution or portfolio strategy can tolerate different operational thresholds.
Step 16: Detect runaway robot behavior
Aggregate order events by robot and one-second window.
CREATE OR REPLACE VIEW robot_ops_lab.gold.robot_order_rate AS SELECT date_trunc('second', event_time) AS event_second, robot_id, strategy_id, COUNT(*) AS order_event_count, COUNT(DISTINCT order_id) AS unique_order_count, SUM(quantity) AS total_quantity FROM robot_ops_lab.raw.order_events GROUP BY date_trunc('second', event_time), robot_id, strategy_id; Join the output to approved strategy limits.
Create alert states:
NORMALWARNINGRATE_LIMIT_BREACHDUPLICATE_ORDER_PATTERNSEQUENCE_GAPUNKNOWN_ROBOTUNKNOWN_STRATEGYSTALE_LIMIT
A critical alert can create an operator-workflow request in Lakebase. It must not issue a live mass cancellation from the Free Edition application.
Step 17: Create an incident timeline
Join Lakebase operational changes with telemetry, order events, and executions.
CREATE OR REPLACE VIEW robot_ops_lab.gold.incident_timeline AS SELECT incident_id, robot_id, opened_at AS event_time, 'INCIDENT_OPEN' AS event_category, incident_type AS event_detail, severity, incident_status FROM robot_ops_lab.raw.lakebase_incident_case_cdf WHERE operation_type IN ('INSERT', 'UPDATE'); Extend the timeline with:
- Configuration load.
- Robot start request.
- Confirmed state.
- Market-data degradation.
- Clock warning.
- Order-rate breach.
- Stop request.
- External confirmation.
- Incident closure.
Preserve source timestamps and ingestion timestamps. Do not overwrite the timeline with a corrected narrative. Add corrections as new events.
Step 18: Configure Lakehouse Real-Time where available
Lakehouse//RT is Beta...
