# Tiflash
__*TiFlash features*__
+ Asynchronous replication
+ consistency
+ column oriented store improves analysis query efficiency
+ Business isolation
+ Engine smart selection

![center](./student-guide/diagram/TiFlash_aa_001_20220506.png)

------------------------------------------------------------
We will introduce the main functions and implement principles of TiFlash in detail. Let us take a brief look at its main functions.

1. Asynchronous replication
replica in TiFlash perform asynchronous data replication as a special character (Raft Learner). This means that when the TiFlash node goes down or the network has high latency, TiKV can still ensure normal operation.
This replication mechanism also inherits the automatic load balancing and high availability of the TiKV system: it does not rely on an additional replication pipeline, but directly receives TiKV data transmission in a many-to-many manner; and as long as the data in TiKV is not lost, a replica of TiFlash can be recover at any time.

2. consistency
TiFlash provides the same snapshot isolation support as TiKV, and ensures that the read data is up to date (ensuring that previously written data can be read). This consistency is achieved by verifying the replication progress of the data.
Each time a read request is received, the Region replica in TiFlash initiates a progress check (a very light RPC request) to the Leader replica, and only responds to reads if the progress ensures that it contains at least the data covered by the read request timestamp.

3. column oriented store improves analysis query efficiency
TiFlash is different from TiKV, which uses a column oriented store data structure. It can also be said that TiFlash is a storage version of TiKV. As we all know, column store storage is very friendly to statistical analysis queries, and row storage is friendly to transaction business, so we can put statistical analysis queries and other services that require violent scanning on TiFlash to improve efficiency, plus The introduction of MPP (Massively Parallel Processing) functional architecture distributes computing tasks to multiple server nodes in parallel. After the calculation is completed on each node, the results of each part are summarized together to obtain the final result, making the analysis query service on TiFlash more efficient.

4. Business isolation
As mentioned earlier, the column store is very friendly to statistical analysis queries (OLAP) and the row store is friendly to transaction (OLTP), so TiKV and TiFlash can be used in two business scenario, OLTP and OLAP respectively. In this way, the two businesses are isolated and will not interfere with each other.

5. Engine smart selection
Whether it is TiKV or TiFlash, their SQL entry is TiDB Server. The optimizer model in TiDB Server can smart selection whether to read data from TiKV row store or TiFlash column store storage according to the characteristics of the SQL statement.