2 · MERGETREE · ДВИЖКИ ТАБЛИЦ
Table Engines: Which One to Use and When
MOTOR
WHAT IT DOES
WHEN TO TAKE IT
MergeTree
сортированные части, разреженный индекс, партиции, TTL
events, logs, facts
ReplacingMergeTree
при слиянии оставляет последнюю версию строки по ключу
String Versions (CDC)
SummingMergeTree
When merging, it combines numeric columns based on the key
meters
AggregatingMergeTree
stores the states of units (uniqState, etc.)
MV receiver: DAU, quantiles by day
CollapsingMergeTree
Lines with the values +1 and −1 cancel each other out
меняющееся состояние: сессия, онлайн
Replicated…MergeTree
The same engines + copies on several servers
Production: Fault Tolerance
Distributed
It does not store any data; it sends a query to the shards
a cluster of several servers
Kafka, PostgreSQL, S3
Links to external systems
Reading streams and so on
Memory, Log, Null
in memory · small tables · stores nothing
тесты, справочники, вход конвейера MV
MergeTree. This is the foundation of the family: Replacing, Summing, Aggregating, and Collapsing. MergeTree is the same as MergeTree but with a special merge rule.