什么是HTAP?混合事务/分析处理简明指南
DataHot 速览
文章以支付系统为例解释HTAP,即在同一系统中同时处理事务与分析负载;随后比较TiDB、AlloyDB和Databricks Lakebase的实现。TiDB用TiKV行存与TiFlash列存,通过Raft日志异步复制并检查数据版本;AlloyDB采用内存列式引擎,Google称分析查询最高快100倍;Lakebase/LTAP将计算分离在共享数据层上。文章还建议评估时关注复制延迟、列式覆盖率和代表性查询与更新模式。
为什么值得关注:帮助数据从业者理解HTAP架构、选型权衡与实时分析场景,并给出可操作的评估要点。
本文目录 14 节
- Real-world HTAP databases and implementations
- TiDB: Separate row and column engines
- AlloyDB: One database with a columnar path
- Lakebase and LTAP: Separate compute over a shared data layer
- HTAP in modern data architecture: When is it the right choice?
- When to keep OLTP and OLAP separate
- HTAP migration and adoption playbook
- Wrapping up
- Frequently asked questions
- What is HTAP?
- What is an HTAP database?
- What is HTAP in databases?
- What is the difference between OLTP and OLAP?
- What is LTAP?
原文
Real-world HTAP databases and implementations
You can see the different ways HTAP systems separate transactional and analytical workloads in systems such as TiDB, AlloyDB, and Databricks Lakebase. Each takes a different approach to transaction processing, analytical processing, and the data path between them.
TiDB: Separate row and column engines
TiDB illustrates a composed HTAP architecture. In 2020, PingCAP published a VLDB paper describing TiDB as a Raft-based HTAP database, and its decoupled architecture integrates row and column storage for hybrid workloads. Transactional workloads use TiKV, a row-based storage engine, while TiFlash maintains a columnar representation for analytical queries. TiDB's optimizer can route queries to TiKV, TiFlash, or both, with the two paths running on separate nodes for greater workload isolation.
TiFlash receives replicas asynchronously through the Raft log but checks whether it has reached the data version required by a query to provide snapshot isolation. When evaluating this approach, consider how replication lag affects analytical latency and throughput during sustained transactional writes.
AlloyDB: One database with a columnar path
AlloyDB takes a more converged approach. It operates with a transparent in-memory columnar engine that accelerates analytical operations such as scans, joins, and aggregations. The engine can run on the primary instance or on read-pool instances for greater workload isolation. Google states that AlloyDB delivers up to 100x faster analytical queries than standard PostgreSQL.
When evaluating this approach, consider how much of your workload can use the columnar path. Unsupported operations or data unavailable in the columnar engine may fall back to the row-oriented path, while frequent updates can require columnar data to be refreshed. Test columnar coverage and performance using representative query and update patterns.
Lakebase and LTAP: Separate compute over a shared data layer
Lakebase with LTAP takes the separation between transactional and analytical workloads further. Rather than serving both through the same database engine, it keeps their compute independent while connecting them through a shared data layer. Postgres compute can remain optimized for low-latency transactions, while analytical compute processes the same operational data without placing analytical workloads on the primary database.
This separation also allows the two sides to scale independently. Transactional capacity can follow application traffic, while analytical capacity can follow query demand, without requiring one workload to provision resources for the other. For live reads, analytical compute reads the bulk of data from the columnar copy in object storage, fetches only the current log position from Postgres, and merges any very recent changes from the pageserver to provide a transactionally consistent view, without placing analytical workload on the primary Postgres instance.
HTAP in modern data architecture: When is it the right choice?
HTAP has been pitched as the next big DB architecture more than once. In practice, it is a good fit when the value of your analysis depends on access to fresh operational data. Start by asking how much delay your workload can tolerate. If data becomes less useful while moving from a transactional system to a separate analytical system, reducing that delay may justify an HTAP architecture.
That question matters more as emerging workloads such as AI agents and real-time personalization need current state and historical context at the same time. It is also why the conversation has shifted away from tightly coupled warehouses toward modular lakes built on open formats, where transactional and analytical systems can share data without forcing every workload into one engine.
Common use cases include:
| Use case | Why fresh data matters | What to evaluate |
|---|---|---|
| Real-time business intelligence | You need dashboards and metrics to reflect recent operational activity. | Freshness, analytical concurrency, and transaction latency |
| Operational analytics | You use analytical results to inform an active workflow or decision. | Consistency, query latency, and workload isolation |
| AI applications and agents | Your application needs current operational state alongside historical context to make decisions or take actions. | Serving latency, freshness, consistency, and transaction impact |
| Feature serving | You need fresh features alongside historical features for predictions or personalization. | Serving latency, freshness, consistency, and update frequency |
| Fraud detection | You need to combine new events with recent and historical activity before making a decision. | End-to-end decision latency, freshness, and availability |
Choose the architecture based on how much freshness and workload isolation you need. Converged HTAP can work well when transactional and analytical workloads can safely share an operating environment. Composed HTAP provides stronger compute isolation when synchronization can still keep analytical data current enough for your workload.
When to keep OLTP and OLAP separate
Keep OLTP and OLAP separate when your analytical workloads can tolerate some delay. Historical analysis, model training, advanced analytics, and regulatory reporting can often remain on a dedicated OLAP database or in cloud data warehouses, especially when you need to protect transactional latency and availability through stronger workload isolation.
Consider your existing architecture as well. If your CDC or ETL data processing already meets your freshness, performance, reliability, and cost requirements, moving to HTAP may introduce migration risk and operational complexity without enough benefit. HTAP is most valuable when reducing data delay solves a specific application or business problem.
HTAP migration and adoption playbook
Once you have validated that an HTAP architecture can meet your workload requirements, adopt it incrementally. Set clear success criteria at each stage and make sure you can return to the existing path if those criteria are not met.
A practical migration sequence is:
- Map your workloads and dependencies: Identify the applications, queries, pipelines, and downstream consumers involved. Separate transactional and analytical workloads from those that genuinely need both.
- Set your guardrails: Define acceptable thresholds for transaction latency, analytical performance, freshness, correctness, availability, and cost. Decide in advance what would cause you to pause or roll back.
- Start with analytical reads: Where possible, run the existing and new analytical paths in parallel. Compare results, freshness, and performance before the new path affects application behavior.
- Shift traffic gradually: Move suitable workloads in stages while monitoring the new path and its effect on transactional performance.
- Test failure and recovery: Verify what happens when synchronization falls behind, components fail, or traffic returns to the previous path. Test these procedures before you depend on them in production.
- Migrate writes only if needed: If adoption changes your system of record, first validate durability, schema evolution, downstream dependencies, and rollback behavior.
Use the migration to review your schemas, indexes, and access patterns. HTAP can change how you store and query data, but it cannot compensate for a data model that does not fit your workload.
Wrapping up
HTAP can reduce the gap between transactions and analytics, but the right architecture depends on your workload. Start with the transaction latency, analytical performance, freshness, consistency, and isolation your application requires, then test those requirements together under representative mixed load.
If transactional and analytical compute need to scale independently while remaining connected through a shared data layer, Databricks Lakebase provides a Postgres-compatible transactional foundation for the lakehouse and the data lake beneath it. Explore Lakebase to see how Databricks approaches LTAP and evaluate where it meets your workload requirements.
Frequently asked questions
What is HTAP?
HTAP stands for Hybrid Transactional/Analytical Processing. It is a database architecture that brings online transaction processing (OLTP) and online analytical processing (OLAP) together, allowing applications to analyze operational data while it is still current.
What is an HTAP database?
An HTAP database supports both transactional and analytical workloads. Converged systems handle both through a single database engine, while composed systems use separate transactional and analytical engines connected through shared storage, replication, or other synchronization mechanisms.
What is HTAP in databases?
In databases, HTAP reduces the traditional separation between operational and analytical systems. It gives analytical queries access to fresher transactional data without relying entirely on moving that data through a separate batch ETL pipeline first.
What is the difference between OLTP and OLAP?
OLTP databases process high volumes of small transactions using row-oriented storage and low-latency access. OLAP databases run complex queries over large datasets using columnar storage, accepting longer latency in exchange for efficient scans and aggregations.
What is LTAP?
LTAP stands for Lake Transactional/Analytical Processing. It serves both transactional and analytical workloads from a unified storage layer in the lake, under one governance model, removing the CDC and replication pipelines teams traditionally maintain to keep separate systems in sync. This allows each workload to optimize and scale independently while operating on a common data foundation.
这篇内容对你有用吗?
反馈只用于改善内容筛选,不等同于收藏