ReinDBby Bandlei

Blog · Federal

From a Postgres cluster to a hybrid lakehouse: Iceberg and Trino vs. the Oracle routes, for federal and air-gapped sites

Brett Rosenblatt ·

A common request in federal shops goes like this: "Our Postgres cluster has ten years of history in it, the analysts are hammering the primary, and the cloud team wants a data lake. Can we turn Postgres into a lakehouse that runs on-prem and in GovCloud?" The other half of the conversation is usually "or do we just go to Oracle on Exadata?"

The second option is a bigger move than it sounds. Exadata runs Oracle Database and nothing else, so you can't put your Postgres cluster on it. The Oracle route means either migrating the applications to Oracle Database or keeping Postgres and feeding a separate Oracle warehouse from it. Both questions are fair, and both start from a couple of assumptions worth fixing first.

First, what you're actually building

You don't turn Postgres into a lakehouse. Postgres (or Oracle) remains your system of record: transactions, constraints, the thing the applications write to. The lakehouse sits beside it and holds a copy of the data in open files that many engines can read. The first advantage is that the 40-table report joining five years of history stops running on your primary. It's also smaller and faster for analytics, and it can cost less, though not always (see Cost below).

The open-source stack splits the work into separate jobs, and each tool does one of them. They aren't alternatives to each other:

Job Tool What it does
Capture changes (Postgres) Debezium, on Kafka Connect Reads Postgres logical replication (WAL) and turns every insert, update and delete into an event
Capture changes (Oracle) Debezium Oracle connector, on Kafka Connect (or GoldenGate, if you already own it) Reads Oracle redo and archive logs (Debezium through LogMiner) and turns every insert, update and delete into an event
Move them Apache Kafka Durable, replayable log between the database and everything downstream
Store tables Apache Iceberg, on object storage An open table format: Parquet files plus metadata that gives you snapshots, schema changes and time travel
Track tables An Iceberg catalog (REST catalog such as Apache Polaris, Nessie or Lakekeeper; or Hive Metastore) Knows which metadata file is the current version of each table
Query Trino Distributed SQL engine that reads Iceberg and can also query Postgres/Oracle live
Transform dbt Versioned SQL models that turn raw change tables into clean, tested reporting tables

So "Iceberg plus Trino, or dbt, or Kafka" is really "Kafka and Debezium to get data in, Iceberg to hold it, Trino to query it, dbt to shape it." You can skip Kafka for a small system, but you don't pick it instead of Trino.

The data path looks like this:

Postgres (primary) --WAL--> Debezium --> Kafka --> Iceberg sink --> Iceberg tables
                                                                   (object storage)
                                                                         |
                                     dbt models (run through Trino) <----+
                                                                         |
                                     Analysts / BI --> Trino ------------+
                                                         \--> Postgres (live lookups)

The Apache Iceberg project ships a Kafka Connect sink that commits change events to Iceberg tables, so this pipeline is all Apache-licensed parts.

Lighter options

If you don't need streaming, there are simpler ways in:

The DBA part nobody puts on the architecture slide

Debezium reads from a logical replication slot, and a slot holds WAL until the consumer confirms it. If Kafka Connect is down over a long weekend, WAL piles up in pg_wal until the disk fills and the primary stops. On a SCIF network, where the person who can fix Kafka might not be on site until Monday, that's the failure you plan for first:

SELECT slot_name, active,
       pg_size_pretty(pg_wal_lsn_diff(pg_current_wal_lsn(), confirmed_flush_lsn)) AS behind
FROM pg_replication_slots
WHERE slot_type = 'logical';

Alert on that number. On PostgreSQL 13 and later, set max_slot_wal_keep_size so a dead consumer costs you a re-snapshot instead of an outage.

Other things that hurt:

Where "hybrid" gets complicated in federal

On a commercial site, hybrid means the same Iceberg tables are readable from on-prem Trino and from a cloud engine, because they're just files on S3-compatible storage. In federal it depends on the classification of the data:

Some compliance points that get blurred in sales decks:

Object storage on-prem

The lake needs S3-compatible storage. For years the default answer was MinIO, but its community edition stopped shipping prebuilt binaries and images in October 2025, went into maintenance mode that December, and the repository was archived in 2026. For a new build, look at Ceph RGW (mature, needs real expertise), a storage array with a native S3 interface, or a supported commercial object store. Whatever you pick, make sure someone can patch it for the life of the ATO.

The Oracle routes, fairly

"Oracle means cloud-only warehousing or an expensive Exadata" isn't the whole picture. Oracle has more on-prem and federal options than most people assume. One thing doesn't change across all of them: every option below runs Oracle Database only. For a Postgres shop that means one of two paths:

Where it can run:

So the honest framing isn't "open source on-prem vs. Oracle in the cloud." Both can run in your building, both can run in an authorized government cloud, and both can read Iceberg. The real differences are cost, who runs it, and how much you depend on one vendor.

Already on Oracle? Keep it as the system of record and offload the analytics

The open lakehouse doesn't need Postgres at all. If Oracle is your system of record and the reporting/analytics load is what's pushing you toward more cores or a new Exadata, you can leave Oracle exactly where it is and move only the analytics out.

To be clear about what "the lake" is here: it's Iceberg tables on object storage, queried by Trino. It isn't a Postgres database. Postgres shows up in this picture only as one more source, or as a small serving database for an app that needs a few aggregates with low latency.

The pipeline has the same shape as before, with a different first step:

Oracle (system of record) --redo--> Debezium or GoldenGate --> Kafka --> Iceberg tables
                                                                              |
                         Analysts / BI --> Trino ----------------------------+
                                             \--> Oracle (live lookups, sparingly)

Capture. Two realistic options:

Query. Trino reads the Iceberg copy for the heavy work. Its Oracle connector can also join live Oracle tables when someone truly needs the last few seconds of data. Use that sparingly, because every federated query lands back on the database you were trying to protect. If you point it at a standby instead, remember that opening a physical standby read-only while it applies redo is Active Data Guard, which is a separately licensed option.

The win. Month-end reports, ad hoc analyst queries and data science extracts stop competing with transactions. On a per-core license, analytics you don't run on Oracle are cores you don't have to buy, and that can be the difference between tuning the box you have and buying a bigger one.

What to plan for:

Cost: compare the whole bill

Exadata is expensive. Oracle Enterprise Edition is licensed per processor core, the options you'll want for a warehouse (Partitioning, Advanced Compression, often RAC) are extra, and support runs about 22% of the license price every year. Cloud@Customer turns that into a subscription, but it isn't cheap either. And for a Postgres shop, add the migration: moving applications to Oracle Database costs developer time, testing and risk, and that belongs in the Oracle column too.

The open stack has no license fee, and that's where a lot of comparisons stop. They shouldn't. Count:

Where open source clearly wins:

Where Oracle clearly wins:

A rough way to decide

Whichever way you go, keep watching the source database. The lake moves the reporting load off the primary, but the replication slot, the long-running export or the "temporary" ad hoc connection is what usually takes it down.

If you've built a lakehouse in a disconnected environment, I'd like to hear how you handled the cross-domain step and compaction. Those are the two parts nobody seems to write down.


Brett Rosenblatt is a DBA and performance engineer and a co-founder of Bandlei, which makes ReinDB, a read-only performance monitor for PostgreSQL, Oracle and other databases.