Skip to main content

Four challenges,
four designs with TDP.

A legacy system that cannot be touched, decisions that must happen together with the event, areas with different truths about the same subject, and models that depend on reliable data. For each case, a design with the TDP components in the role the configuration guides document.

The designs are illustrative. Each section says where the situation usually appears, what the platform does and what stays in the organization's systems.

A single data view over legacy systems​

An old system keeps the registry that everyone needs. It cannot be modified, and the production database cannot be overloaded.

Where it appears: an ERP or a central registry that several applications query; a service center that needs the complete view of the customer; portals that today read the source database directly.

Reference architecture: the legacy stays, the single view is bornThe legacy system is not modified: Debezium, on Kafka, captures the changes from the database. The other sources, such as files, APIs and organization systems, enter through NiFi by batch load or by API. Spark writes the raw, integrated and indicators layers as Iceberg or Delta Lake tables in Ozone, registered in the Hive Metastore; Airflow schedules the jobs. Trino queries the tables and serves the Superset dashboards and the organization's applications. Ranger applies profiles, column masking and auditing, and OpenMetadata maintains the catalog and lineage.SOURCESINGESTIONPROCESSINGLAKEHOUSECONSUMPTIONLegacy systemdatabase: PostgreSQL, MySQL,SQL Server or OracleOther sourcesfiles, APIs andorganization systemsApache KafkaDebezium: change datacapture (CDC)Apache NiFibatch loador via APIApache Sparkraw → integrated→ indicatorsApache Airflowschedules the jobsApache OzoneIceberg tablesor Delta LakeHive Metastoretable catalogTrinoSQL over the tablesApache SupersetdashboardsApplicationsof the organizationCross-cutting governanceRanger: profiles, column masking and auditing · OpenMetadata: catalog and lineage
Figure 1 - A single data view over legacy systems: changes become events, the lakehouse integrates, Trino delivers

The design:

  1. Capture without touching the legacy: a Debezium connector, in Kafka Connect, reads the database transaction log and publishes each change in the registry as an event. The legacy application does not change, and there are no extraction queries against the production database.
  2. The other sources come in by batch or by API: NiFi flows fetch the data from files, APIs and other systems and write it to the Ozone S3 storage.
  3. Three layers of tables: Spark jobs, scheduled by Airflow, write the raw data as it arrived, then the processed and integrated data, with the sources joined by common keys, and finally the ready-made indicators. All as Iceberg or Delta Lake tables registered in the Hive Metastore.
  4. Consumption by SQL: Trino queries the tables and serves the Superset dashboards and the organization's applications.
  5. Cross-cutting governance: in Ranger, group policies decide who sees each column, mask documents and contact details for those who do not need the real value, and record each decision in the audit. OpenMetadata maintains the catalog and the lineage of the tables.
ComponentRole in this design
Kafka with DebeziumCapture of the legacy database changes, without modifying the application
NiFiLoad of the other sources by batch or by API, into the S3 storage
Spark and AirflowRaw, integrated and indicators layers, in scheduled jobs
Ozone, Iceberg or Delta Lake, Hive MetastoreLakehouse tables and the catalog that Spark and Trino share
Trino and SupersetSQL over the tables, for the dashboards and the applications
Ranger and OpenMetadataProfiles, masks, audit, catalog and lineage
Organization's systems

The legacy and the applications that consume the data. The platform receives from them and delivers to them.

Real-time decisions on events​

Events arrive all the time, but irregularities only show up later, through sampling and manual cross-checks.

Where it appears: transactions that need verification on the spot; sensor readings and operation logs; passages through checkpoints; orders that must be checked against limits and restriction lists.

Reference architecture: deciding while the event happensBusiness events, sensor signals and logs, and reference data enter Kafka topics. A Flink job keeps keyed state, applies rules with event time and detects patterns with CEP. Each triggered rule becomes an event in the decisions topic, with alerts and actions, consumed by the organization's systems. The history of events and decisions is stored in HDFS, in Hive tables, and feeds the Superset dashboards. Ranger applies per-team policies on Kafka and Hive, and Kerberos authenticates the services.SOURCESINGESTIONPROCESSINGSTORAGECONSUMPTIONBusiness eventstransactions, orders,operation recordsSignalssensors, logs,point crossingsReference datalists, thresholdsand rulesApache Kafkaevent topicsApache Flinkkeyed state, eventtime, rules and CEPHDFS + Apache Hivehistory of eventsand decisionsDecisions topicalerts and actionsin KafkaOrganization systemsact oneach decisionApache Supersetoperations dashboardsCross-cutting governanceRanger: per-team policies on Kafka and Hive · Kerberos: service authentication
Figure 2 - Real-time decisions on events, in TDP Datacenter: Flink applies the rules, Kafka delivers the decisions

The design:

  1. Everything becomes an event: business events, signals and reference data, such as lists and limits, enter Kafka topics.
  2. Rules with state and time: a Flink job keeps the state per key, such as a customer, an order or a piece of equipment, matches each event against the reference data and the history of that key, compares the observed sequence with the expected one in event time and detects patterns with the CEP library. Checkpoints recover the state after a failure, without counting an event twice.
  3. Decisions at the moment of the event: each triggered rule becomes an event in a decisions topic, with the alert or the action, which the organization's systems consume.
  4. History for analysis: the events and decisions are written to HDFS, in Hive tables, and feed the Superset operations dashboards.
  5. Cross-cutting governance: Ranger applies team policies on Kafka and Hive, and Kerberos authenticates the services.
ComponentRole in this design
KafkaInput event topics and the decisions topic
FlinkState per key, event-time rules, CEP and checkpoints
HDFS and HiveHistory of the events and decisions, in tables
SupersetOperations dashboards over the history
Ranger and KerberosTeam policies and service authentication
Organization's systems

Those that emit the events and those that act on each decision, such as a portal, a field application or an order system.

A single record across areas​

Each area keeps its own registry of the same subject. The numbers do not add up, and the same person or product shows up in different ways.

Where it appears: customers registered by sales, billing and support; suppliers and contracts in purchasing and finance systems; products with different codes per channel; programs of the same organization that serve the same public.

Reference architecture: many areas, one truth per subjectThe records of each area, such as customers, suppliers, products and contracts, and the reference data enter through NiFi, in batch, and through Kafka, which captures the changes of the records in SQL databases. Spark standardizes and joins the records and writes three layers of tables in Ozone: raw, as received from the source; integrated, one table per subject; indicators, ready for consumption. The Hive Metastore registers the tables, and Airflow schedules the steps. Trino queries the layers and serves the Superset dashboards and the JupyterHub notebooks. OpenMetadata applies quality tests and maintains the lineage, and Ranger decides who sees each column.SOURCESINGESTIONPROCESSINGLAKEHOUSECONSUMPTIONApache OzoneRawas received from the sourceIntegratedone table per subjectIndicatorsready for consumptionRecords per areacustomers, suppliers,products, contractsReference dataofficial tables,territories, codesApache NiFibatch loadsApache KafkaCDC of the recordsin SQL databasesApache Sparkstandardizes, joinsand writes the layersApache Airflowschedules the stepsHive Metastoretable catalogTrinoSQL over the layersApache Supersetdashboards per areaJupyterHubanalysis in notebooksCross-cutting governanceOpenMetadata: quality tests and lineage · Ranger: who sees each column of each layer
Figure 3 - A single record across areas: three layers of tables and one integrated table per subject

The design:

  1. Inputs: the registries and the reference data come in through NiFi, in batch, and the registries kept in SQL databases come in through Kafka, as changes captured by Debezium.
  2. Raw: each source becomes a table with the records as they arrived. Nothing is corrected here, which allows the following layers to be redone.
  3. Integrated: Spark jobs standardize the fields and join the registries by common keys, in one table per subject: customer, supplier, product, contract. The OpenMetadata quality tests, at table and column level, check whether the data is complete, up to date and correct, and the lineage shows which registry each field came from.
  4. Indicators: ready-made tables per area and per period, queried by Trino, published in Superset and explored in JupyterHub notebooks.
  5. Cross-cutting governance: in Ranger, each area sees the columns that its purpose requires, in each layer.
ComponentRole in this design
NiFi and Kafka with DebeziumInput of the registries in batch and by change capture
Spark and AirflowRaw, integrated and indicators layers, in scheduled jobs
Ozone, Iceberg or Delta Lake, Hive MetastoreLakehouse tables and the shared catalog
OpenMetadataQuality tests and lineage of the integrated tables
Trino, Superset and JupyterHubSQL, dashboards per area and analyses in notebooks
RangerWho sees each column of each layer
Organization's systems

The systems of each area remain as the source. The business rules of each one stay in them.

Machine learning on the platform data​

A model needs the data that the platform already integrates, and the result must reach those who decide, without copies leaving the platform.

Where it appears: classifying tickets, orders or documents by subject; estimating demand, risk or deadlines; detecting records outside the pattern.

Reference architecture: from data to model without leaving the platformThe integrated table of the lakehouse, in Ozone, is read in a JupyterHub notebook with the PySpark from the TDP image. Training uses Spark MLlib on the cluster itself, and the version of the table used in training remains available through time travel. The results, such as classifications, scores or predictions, return to the lakehouse as a table, queried by Trino, published in a Superset dashboard and consumed by the organization's applications, which act on the result. Ranger decides who reads the tables, and OpenMetadata maintains the lineage of the results table.LAKEHOUSENOTEBOOKTRAININGRESULTCONSUMPTIONIntegrated tableintegrated layer of thelakehouse (Ozone)Training versiontable snapshot(time travel)JupyterHubnotebook with PySparkfrom the TDP imageApache SparkMLlib: training onthe cluster itselfResults tableclassifications, scoresor predictionsTrinoqueries the resultsApache Supersetdashboard with the resultsApplicationsof the organization,which act on the resultCross-cutting governanceRanger: who reads the integrated and results tables · OpenMetadata: results table lineage
Figure 4 - Machine learning on the platform data: training reads the lakehouse, and the result goes back to it

The design:

  1. The source is the integrated layer: the subject table, already standardized and governed, is the training set.
  2. Training in the cluster: in the JupyterHub notebook, the PySpark from the TDP image reads the table and trains the model with Spark MLlib, in the cluster itself. The table version used in training remains available through time travel, to reproduce the result.
  3. The result goes back as a table: the classifications, scores or predictions are written to the lakehouse, in a table with its lineage recorded in OpenMetadata.
  4. Consumption: Trino queries the results, Superset publishes them in a dashboard, and the organization's applications consume the result and act on it.
  5. Cross-cutting governance: Ranger decides who reads the integrated table and the results table.
ComponentRole in this design
Ozone, Iceberg or Delta LakeIntegrated table, version used in training and results table
JupyterHubNotebook with the PySpark from the TDP image
SparkTraining with MLlib, in the cluster
Trino and SupersetQuerying and dashboard of the results
OpenMetadata and RangerLineage of the results table and who reads it
Organization's systems

The applications that act on each result, such as routing a ticket or prioritizing an order.

Next steps​