# Tiflash Architecture


![left](./student-guide/diagram/30-Architecture-01-01.png)
------------------------------------------------------------
Raft Learner
TiFlash is a key component of the TiDB HTAP pattern. It is a column store scale of TiKV that provides good isolation while also taking into account strong consistency. The column store replica is asynchronously replicated via the Raft Learner protocol, but at the time of reading, the consistent isolation level of Snapshot Isolation is achieved through the Raft Proofing Index in conjunction with MVCC. This architecture solves the problem of isolation and column store synchronization of HTAP scenario well.
The above figure shows the TiDB HTAP pattern architecture, which contains TiFlash nodes.

TiFlash provides column oriented store and has an efficient coprocessor layer. In addition, it is very similar to TiKV, relying on the same Multi-Raft system to replicate and distribute data in Region.
TiFlash replicates the data in the TiKV cluster in real time with low consumption and non-blocking TiKV writes, while providing consistent read like TiKV, and ensures that the latest data is read. The Region replica in TiFlash corresponds exactly to the TiKV, and is split and merged with the Leader replica in TiKV at the same time.

TiFlash is compatible with TiDB and TiSpark, and users can choose to use different computing engines.
TiFlash recommends using a different node than TiKV for workload isolation, but you can also choose to deploy on the same node as TiKV without service isolation.
TiFlash cannot accept data writing directly for the time being. Any data must be written to TiFlash first and then synchronized to TiFlash. TiFlash accesses the TiDB cluster with the learner role. TiFlash supports table-granular data synchronization. After deployment, no data is synchronized by default. You need to follow the section on Building TiFlash replica by Tables to complete the data synchronization of the specified tables.

In addition, for TiFlash, we need to master:
1. TiFlash cannot withstand high concurrency, and the average QPS cannot be higher than 50.
2. TiFlash's region is exactly the same as TiKV, and the partition is the same.
3. TiFlash is suitable for scenario the entire table or most of the data in the table must be fetched and read.
4. TiFlash performance improvements are in column store, aggregation, and join.