> Markdown version of https://www.artie.com/blogs/what-are-the-differences-between-oltp-and-olap-databases. Site index for AI agents: https://www.artie.com/llms.txt

[Back to blog](https://www.artie.com/blogs)

Data know-how Updated November 18, 2026

# OLTP vs OLAP Databases: Key Differences and How Data Moves Between Them

[Robin Tang Co-founder & CTO](https://www.artie.com/authors/robin-tang)

[Share on LinkedIn (opens in a new tab)](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fwww.artie.com%2Fblogs%2Fwhat-are-the-differences-between-oltp-and-olap-databases) [Share on X (opens in a new tab)](https://x.com/intent/post?text=OLTP%20vs%20OLAP%20Databases%3A%20Key%20Differences%20and%20How%20Data%20Moves%20Between%20Them\&url=https%3A%2F%2Fwww.artie.com%2Fblogs%2Fwhat-are-the-differences-between-oltp-and-olap-databases)

An OLTP database runs the application: many small reads and writes, each touching one row or a few, each finishing in milliseconds. An OLAP database answers questions across millions of rows, reading a few columns at a time.

Many organizations run both and feed the OLAP copy from the OLTP database. The hard part is keeping that copy current and correct: hard deletes, unchanged TOAST values and schema changes all break a naive copy.

## OLTP vs OLAP: key differences

| Category         | OLTP                                                                                                                     | OLAP                                                               |
| ---------------- | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------ |
| Type of workload | Inserting, reading, updating and deleting individual records. This is what an application does while it serves requests. | Read-heavy. Scans and aggregations for analysis and reporting.     |
| Access patterns  | Well-known. Queries are optimized by creating indexes for their access patterns.                                         | Ad hoc. Analysts write new queries across many tables and sources. |
| Write pattern    | Single-row `INSERT`, `UPDATE` and `DELETE` statements from the application.                                              | Bulk loads and batched `MERGE` statements.                         |
| Storage layout   | Row-oriented, with B-tree indexes (heap tables in Postgres, clustered on the primary key in MySQL InnoDB).               | Columnar, with compression chosen per column.                      |
| Schema           | Normalized, so each fact is stored once.                                                                                 | Denormalized: star or snowflake schemas, or wide flat tables.      |
| Data sources     | One application's database.                                                                                              | Many databases and SaaS tools combined.                            |
| How data gets in | The application writes it.                                                                                               | Loaded from OLTP databases by batch ETL or CDC.                    |
| Main users       | The application and the people using it.                                                                                 | Data analysts, data scientists and machine learning engineers.     |
| Performance      | Milliseconds per transaction.                                                                                            | Seconds to minutes over large tables, sub-second on some engines.  |
| Examples         | Postgres, MySQL, SQL Server, Oracle                                                                                      | Snowflake, BigQuery, Redshift, ClickHouse, Databricks              |

## What is an OLTP database? Definition and examples

**Online Transaction Processing (OLTP)** databases handle high-throughput, low-latency transactions. Each statement reads or writes a few rows, and each transaction commits in milliseconds with ACID guarantees, so a crash never leaves a payment half-written.

Applications use OLTP databases to answer requests such as:

* Is this session valid?
* Did the card charge succeed?
* Which driver gets this ride?

Take a `rides` table. The app looks up a ride by its ID, then marks it complete when the driver drops the rider off:

SQL

```
-- Point lookup through the primary key index
SELECT ride_id, rider_id, driver_id, status, fare_cents
FROM rides
WHERE ride_id = $1;

-- Finish the ride
UPDATE rides
SET status = 'completed', updated_at = now()
WHERE ride_id = $1;
```

Each statement touches one row through an index, and each has to come back before the rider notices.

Most OLTP databases are relational: Postgres, MySQL, SQL Server, Oracle. Some are NoSQL, like MongoDB and DynamoDB.

Every change is recorded in a transaction log. Postgres writes it to the [write-ahead log](https://www.artie.com/blogs/postgres-write-ahead-logs) before it touches the table files, and MySQL records it in the binary log (binlog). That log is what change data capture reads later.

## What is an OLAP database? Definition and examples

**Online Analytical Processing (OLAP)** databases serve read-heavy workloads for data analysis. Performance still matters, but a query that takes a few seconds is fine. Typical questions:

* How many customers are signing up each month?
* What is the total number of rides per city?
* What is the average rating of a driver?

The second question, split by month, looks like this in Snowflake or Postgres syntax:

SQL

```
SELECT city,
       DATE_TRUNC('month', requested_at) AS month,
       COUNT(*) AS rides
FROM rides
GROUP BY city, month
ORDER BY month, city;
```

It reads two columns across every row in the table and ignores the rest. A columnar engine reads only the blocks for `city` and `requested_at`.

AWS and IBM still define OLAP by the multidimensional cube. In practice, OLAP today usually means a columnar SQL warehouse or engine: Snowflake, BigQuery, Redshift, ClickHouse or Databricks. A warehouse kept seconds to minutes behind its source databases is a [real-time data warehouse](https://www.artie.com/glossary/real-time-data-warehouse).

## Why OLTP and OLAP workloads run on separate systems

A row store keeps all of a row's values together, which suits an app that reads or writes a whole record at a time. A column store keeps each column's values together. A query that needs 5 columns out of 100 reads about 5% of the table, and each column compresses well because its values share a type.

The layout that makes OLAP fast at scans makes single-row updates expensive. ClickHouse describes its column layout as inefficient for single-row mutations, and its docs call `ALTER TABLE ... UPDATE` a heavyweight process that rewrites entire columns in data parts. Its lightweight `UPDATE` writes patch parts instead, and the docs scope it to small updates, up to about 10% of a table. Going the other way, an analytics query on the OLTP primary scans with the same CPU, memory and disks the app's queries need.

HTAP (hybrid transactional/analytical processing) engines keep both layouts in one product. TiDB, for example, keeps columnar TiFlash replicas of its row-stored data. A Postgres read replica takes analytics queries off the primary, but it replays the primary's WAL, so it's still row storage with the same indexes. Some databases ship a separate storage engine per workload: DolphinDB offers an OLAP engine for large-scale analysis alongside TSDB and in-memory OLTP engines.

## How data gets from OLTP to OLAP: batch ETL vs CDC

Picture an order service and a payment service, each with its own Postgres database. A customer places an order, the order service writes it and calls the payment service, which writes the charge to its own database. Analysts want both in one warehouse. SaaS data, like Zendesk tickets or Stripe payouts, usually arrives through API connectors and is out of scope here.

There are two common ways to move the database data.

**Batch ETL** runs on a schedule: a full dump, or a query for rows where `updated_at` is newer than the last run. Freshness is capped at the interval. Polling never sees hard deletes, because a deleted row isn't there to select. It also misses any write path that forgets to bump `updated_at`.

**Log-based [change data capture](https://www.artie.com/glossary/change-data-capture)** reads the WAL or binlog, buffers the changes, and applies them to the warehouse in small batches. Every insert, update and delete arrives as an event.

CDC has a cost on the source. In Postgres, a [replication slot](https://www.artie.com/blogs/postgresql-replication-slots) keeps WAL on disk until the consumer confirms it, so a stalled pipeline can fill the primary's disk. `max_slot_wal_keep_size` (Postgres 13 and later) caps that, at the price of an invalidated slot and usually a re-backfill.

OLTP – order and payment services on Postgres → Change capture – reads the WAL through a replication slot → Buffer – Kafka holds changes while the warehouse catches up → OLAP – batched MERGE into Snowflake or BigQuery

|                    | Batch ETL                                            | Log-based CDC                                                              |
| ------------------ | ---------------------------------------------------- | -------------------------------------------------------------------------- |
| Freshness          | Capped at the schedule interval                      | Seconds to minutes behind the source, set by how often batches are applied |
| Hard deletes       | Never seen by `updated_at` polling                   | Arrive as delete events                                                    |
| Load on the source | A query per table per run; full dumps read every row | Reads the log; tables are read only during backfills                       |
| What fails         | Rows whose `updated_at` wasn't bumped go missing     | A stalled consumer holds WAL on the primary's disk                         |

## What changes when OLTP rows land in an OLAP table

A change event from Postgres doesn't always carry the whole row, and a column store doesn't apply single-row changes cheaply. Plan for these five.

### Deletes

Under the default replica identity, a Postgres delete event carries only the primary key. A destination that needs another column to find the row, like a partition column, doesn't get it. `REPLICA IDENTITY FULL` logs every column's old value, which raises WAL volume. More on that trade-off in our post on [replica identity](https://www.artie.com/blogs/postgres-table-replica-identity).

### Unchanged TOAST values

Postgres stores large values, like a long `jsonb` or `text` value, out of line in TOAST. An update that doesn't touch that column leaves the value out of the event and sends a marker saying it's unchanged. A pipeline that treats the missing value as null overwrites real data in the warehouse. Nothing errors. We covered how to handle [unchanged TOAST values](https://www.artie.com/blogs/why-toast-columns-break-postgres-cdc-and-how-to-fix-it) separately.

### Schema changes

`ALTER TABLE` isn't an event in Postgres logical replication. A new column shows up only when the next row change carries it, so the pipeline has to add the column on the warehouse side before that row lands.

### Merge cost on BigQuery

A CDC pipeline applies updates and deletes with `MERGE`, joined on the primary key. On BigQuery, a merge that joins only on the key gives the optimizer nothing to prune partitions with, so it can scan the whole table. We measured it on a table partitioned by day with three years of history (1,095 partitions, 109.5M rows, 51.5 GB). Each merge applied 500 changes: 300 inserts, 150 updates and 50 deletes.

|                                                | Without partition filter | With partition filter |
| ---------------------------------------------- | ------------------------ | --------------------- |
| Bytes read per merge                           | 5.67 GB                  | 94 MB                 |
| On-demand cost per day, merged every 5 minutes | $9.28                    | $0.16                 |
| Three years of merges                          | About $5,200             | About $175            |

Prices are BigQuery on-demand at $6.25 per TiB. Without the filter, the read grows with history: 237 MB at 30 days, 1.00 GB at 180 days, 1.95 GB at one year. The filter has a limit. A filtered merge reads every column of each partition it touches, so past about 120 partitions in one merge it reads more, not less. The setup and the public benchmark repo are in our post on [partition-aware CDC merges](https://www.artie.com/blogs/bigquery-partition-aware-cdc-merges).

### Merge concurrency

BigQuery runs at most two `UPDATE`, `DELETE` or `MERGE` statements per table at once and queues up to 20 more. Past that, statements fail. A pipeline that issues one merge per change hits that limit fast, so batch changes into fewer merges.

## How to check that the OLAP copy matches the OLTP source

A pipeline can report green while rows go missing. These checks come from [our Postgres to BigQuery guide](https://www.artie.com/learn/postgres-to-bigquery), adapted to the `rides` table. Run them after setup and on a schedule.

1. Compare count and sum over a closed window. Use yesterday, so fewer in-flight changes skew the result. Extra rows in the warehouse point to missed deletes. Equal counts with different sums point to lost updates.

   SQL

   ```
   -- Postgres
   SET TIME ZONE 'UTC';
   SELECT COUNT(*) AS ride_count, SUM(fare_cents) AS fare_cents
   FROM rides
   WHERE requested_at >= CURRENT_DATE - INTERVAL '1 day'
     AND requested_at < CURRENT_DATE;

   -- BigQuery
   SELECT COUNT(*) AS ride_count, SUM(fare_cents) AS fare_cents
   FROM `analytics.rides`
   WHERE requested_at >= TIMESTAMP(DATE_SUB(CURRENT_DATE(), INTERVAL 1 DAY))
     AND requested_at < TIMESTAMP(CURRENT_DATE());
   ```

2. Compare null rates on large columns. Count rows where a large column, say `route_json`, is null in both systems for the same window. A gap is the TOAST problem.

   SQL

   ```
   -- Postgres; in BigQuery, use the table and window from check 1
   SELECT COUNT(*) AS ride_count,
          SUM(CASE WHEN route_json IS NULL THEN 1 ELSE 0 END) AS null_routes
   FROM rides
   WHERE requested_at >= CURRENT_DATE - INTERVAL '1 day'
     AND requested_at < CURRENT_DATE;
   ```

3. Compare freshness against the source. Run `SELECT MAX(updated_at) FROM rides` in both systems and compare the two values with each other. Comparing to the clock makes quiet tables look stale.

Also alert on slot lag, and treat `wal_status = 'lost'` as an incident: the slot is no longer usable.

SQL

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

## Where Artie fits

Artie is managed CDC for production databases.

It streams changes from the transaction log. Initial backfills are bounded reads that never block a write, and they can run from a read replica. The reader confirms its WAL position after each successful write to Kafka, so the replication slot stays small even when the warehouse is slow. In [our DMS benchmark](https://www.artie.com/blogs/artie-vs-aws-dms) at about 22,400 events a second, Artie held 16x less WAL on the source than AWS DMS after ten minutes: 385 MB against 6.1 GB.

Inserts, updates and deletes all land, one row per record, with sub-minute latency. New columns are added as data arrives; renames and type changes are flagged, not applied. When infrastructure fails, Artie's engineers get paged, not yours.

Postgres – app writes commit to the WAL → Artie reader – reads the WAL and confirms its position after each write to Kafka → Kafka – buffers changes when the warehouse slows down → Artie writer – applies inserts, updates and deletes, then commits the offset → Snowflake – one row per record, deletes applied

To set up a pipeline, start with the [docs](https://www.artie.com/docs/quickstart).

## FAQ

### Is a data warehouse OLAP or OLTP?

OLAP: a data warehouse stores data copied from OLTP databases and other sources so analysts can run large queries without slowing the app down.

### Is Snowflake OLTP or OLAP?

OLAP. Snowflake stores standard tables in [columnar micro-partitions](https://docs.snowflake.com/en/user-guide/tables-clustering-micropartitions) built for analytical queries. It also offers [hybrid tables](https://docs.snowflake.com/en/user-guide/tables-hybrid), a row-based storage engine for low-latency transactional work.

### What are examples of OLTP?

Placing an order, updating inventory, a bank transfer, a login and matching a rider with a driver. Each reads or writes a few rows and has to finish in milliseconds.

### What is the difference between OLTP, OLAP and HTAP?

OLTP runs an application's transactions and OLAP runs analysis over large tables. HTAP (hybrid transactional/analytical processing) systems run both workloads in one product, usually by keeping row and column copies of the data. Many organizations still run separate OLTP and OLAP systems linked by a pipeline, for the reasons in [why the workloads run on separate systems](https://www.artie.com/blogs/what-are-the-differences-between-oltp-and-olap-databases#why-oltp-and-olap-workloads-run-on-separate-systems).

### How do you reduce replication lag between OLTP and analytics?

Replace scheduled batch loads with log-based CDC, and apply changes to the warehouse in small, frequent batches. The [batch ETL vs CDC section](https://www.artie.com/blogs/what-are-the-differences-between-oltp-and-olap-databases#how-data-gets-from-oltp-to-olap-batch-etl-vs-cdc) covers the trade-offs, including what CDC costs on the source.

## Related articles

* ### [Introduction to Database Replication](https://www.artie.com/blogs/introduction-to-database-replication)

  [Jacqueline Cheong Co-founder & CEO](https://www.artie.com/authors/jacqueline-cheong)

* ### [Top 10 Database Replication Solutions in 2026](https://www.artie.com/blogs/best-database-replication-solutions)

  [Jacqueline Cheong Co-founder & CEO](https://www.artie.com/authors/jacqueline-cheong)

* ### [Snowpipe vs Snowpipe Streaming: Differences, Costs and When to Use Each](https://www.artie.com/blogs/the-ultimate-guide-to-snowpipe-vs-snowpipe-streaming)

  [Jacqueline Cheong Co-founder & CEO](https://www.artie.com/authors/jacqueline-cheong)

## We’re a data company

## Watch your data replicate live

[Start for free](https://app.artie.com/signup) [Book a demo](https://www.artie.com/contact)
