What is OLTP and OLAP: Difference between revisions
Wikiservice (talk | contribs) (Refresh MemCP documentation: accuracy, operational guidance, performance profile and maintained API reference) |
|||
| Line 1: | Line 1: | ||
<!-- Copyright (C) 2026 Carl-Philip Haensch --> | |||
<!-- SPDX-License-Identifier: GPL-3.0-or-later --> | |||
= What is OLTP and OLAP? = | |||
'''OLTP''' describes operational workloads with frequent inserts, updates, deletes, point lookups, constraints, and short transactions. '''OLAP''' describes analytical workloads that scan, group, join, and aggregate larger portions of a dataset. Real applications commonly mix both. | |||
Row storage can favor whole-record access; column storage can reduce memory traffic when a query uses only a few attributes. Neither layout alone determines whether a system can provide transactions, durability, or good point lookup performance. | |||
MemCP targets mixed workloads. Delta structures, indexes, constraints, and transaction machinery serve operational writes, while compressed columns, batch/parallel scans, and reusable computed relations serve analytical queries. Persistent cold columns may be evicted and reloaded, so workload behavior also depends on memory budget and storage backend. | |||
== Typical query shapes == | |||
{| class="wikitable" | {| class="wikitable" | ||
! Workload !! Typical operations !! Important properties | |||
! | |||
! | |||
! | |||
|- | |- | ||
| | | OLTP || create an order, update inventory, look up one account, enforce unique/foreign keys || short latency, concurrency, atomicity, durability, selective indexes | ||
| | |||
| | |||
|- | |- | ||
| | | OLAP || revenue by month/region, cohort analysis, wide joins, windows, top-k reports || batch scans, compression, parallelism, grouping, ordering, memory bandwidth | ||
| | |||
| | |||
|- | |- | ||
| | | Hybrid/HTAP || ingest events while dashboards aggregate the latest state || consistent visibility between writes and scans, predictable maintenance, no stale export pipeline | ||
| | |||
| | |||
| | |||
| | |||
|} | |} | ||
== Combining both in MemCP == | |||
New writes land in delta state suited to change, while rebuilt main columns use an encoding chosen from their values. Scans combine both under transaction visibility. The planner can use selective indexes for point access and compressed batch pipelines for analytical work, and table ENGINE choice separates durability requirements from physical query layout. | |||
That does not make every mixed workload free of trade-offs. High-contention writes, a hot set larger than RAM budget, long-running snapshots, frequent rebuilds, or analytical queries touching nearly every column can interfere with operational latency. Measure them concurrently, not as isolated best cases. | |||
Whether one MemCP instance is suitable depends on isolation, durability, SQL compatibility, query mix, hot-set size, recovery needs, and measured performance. See [[Transactions and Isolation]], [[Persistency and Performance Guarantees]], and [[Performance Measurement]]. | |||
Latest revision as of 11:59, 28 August 2026
What is OLTP and OLAP?
OLTP describes operational workloads with frequent inserts, updates, deletes, point lookups, constraints, and short transactions. OLAP describes analytical workloads that scan, group, join, and aggregate larger portions of a dataset. Real applications commonly mix both.
Row storage can favor whole-record access; column storage can reduce memory traffic when a query uses only a few attributes. Neither layout alone determines whether a system can provide transactions, durability, or good point lookup performance.
MemCP targets mixed workloads. Delta structures, indexes, constraints, and transaction machinery serve operational writes, while compressed columns, batch/parallel scans, and reusable computed relations serve analytical queries. Persistent cold columns may be evicted and reloaded, so workload behavior also depends on memory budget and storage backend.
Typical query shapes
| Workload | Typical operations | Important properties |
|---|---|---|
| OLTP | create an order, update inventory, look up one account, enforce unique/foreign keys | short latency, concurrency, atomicity, durability, selective indexes |
| OLAP | revenue by month/region, cohort analysis, wide joins, windows, top-k reports | batch scans, compression, parallelism, grouping, ordering, memory bandwidth |
| Hybrid/HTAP | ingest events while dashboards aggregate the latest state | consistent visibility between writes and scans, predictable maintenance, no stale export pipeline |
Combining both in MemCP
New writes land in delta state suited to change, while rebuilt main columns use an encoding chosen from their values. Scans combine both under transaction visibility. The planner can use selective indexes for point access and compressed batch pipelines for analytical work, and table ENGINE choice separates durability requirements from physical query layout.
That does not make every mixed workload free of trade-offs. High-contention writes, a hot set larger than RAM budget, long-running snapshots, frequent rebuilds, or analytical queries touching nearly every column can interfere with operational latency. Measure them concurrently, not as isolated best cases.
Whether one MemCP instance is suitable depends on isolation, durability, SQL compatibility, query mix, hot-set size, recovery needs, and measured performance. See Transactions and Isolation, Persistency and Performance Guarantees, and Performance Measurement.