# Tiflash Architecture
__*TIFlash*__
__*TiFlash architecture*__

![left](./student-guide/diagram/TiFlashArchitecture_aa_001_20220516.png)

------------------------------------------------------------
TiFlash is a key component of the TiDB HTAP form. It is a TiKV column store scale that provides good isolation and also takes into account strong consistency. column store replica is asynchronously replicated via the Raft Learner protocol, but the consistency isolation level of Snapshot Isolation is obtained by matching the Raft check index with MVCC when read. This architecture solves the problem of isolation of HTAP scenario and synchronization of column store well.

The figure above shows the TiDB HTAP pattern architecture, which contains TiFlash nodes.

TiFlash provides column oriented store and has an efficient co-processor layer. In addition, it is very similar to TiKV and relies on the same Raft Region for data replication and distribution in Regions.

TiFlash replicates the data in the TiKV cluster in real time with low consumption and does not block TiKV writes, and at the same time provides consistent read like TiKV, and ensures that the latest data is read. The Region replica in TiFlash corresponds exactly to TiKV, and will be split and merged at the same time as the Leader replica in TiKV.

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 in the absence of service isolation, it is also possible to choose to deploy on the same node as TiKV.

TiFlash is temporarily unable to accept data writing directly. Any data must be written to TiKV and then synced to TiFlash. TiFlash accesses the TiDB cluster as a learner. TiFlash supports table-granular data synchronization. After deployment, no data will be synchronized by default. You need to complete the data synchronization of the specified table according to the section Building a TiFlash replica by Table.

Also, 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.