SlideShare a Scribd company logo
18:15 Opening word (Javier Santana)
18:25 ClickHouse introduction (Alexander Zaitsev, Altinity)
19:00 ClickHouse 2019 new features (Alexey Milovidov, Yandex)
19:40 Coffee break
20:00 From legacy to ClickHouse (Iago Enriquez, Idealista)
20:25 1027 predictive models in 10 seconds (David Pardo Villaverde, Corunet)
21:55 Shipping Data from Postgres to Clickhouse (Murat Kabilov, Adjust)
21:20 More Q&A and closing remarks
21:30 Networking, beer etc.
What Is ClickHouse?
© http://mattturck.com/
ClickHouse DBMS is
Column Store
MPP
Realtime
SQL
Open Source
http://clickhouse.yandex
• Developed by Yandex for Yandex.Metrica
• Yandex (NASDAQ: YNDX) – “Russian Google” (50% market share in
search, 50+ b2b and b2c products)
• Yandex.Metrica – world 2nd largest web analytics platform
• Open Source since June 2016 (Apache 2.0 license)
• 200+ companies using in production today
• Several hundred experimenting, doing POC etc.
• Dozens of contributors to the source code
Why Yet Another DBMS?
SQLFlexible
ClickHouse
•Fast!
•Flexible!
•Free!
•Fun!
How Fast?
:) select count(*) from dw.ad8_fact_event;
SELECT count(*)
FROM dw.ad8_fact_event
┌───────count()─┐
│ 1261705085657 │
└───────────────┘
1 rows in set. Elapsed: 3.552 sec. Processed 1.26 trillion rows, 1.26 TB (355.22 billion
rows/s., 355.22 GB/s.)
Altinity Ltd. www.altinity.com
1+ trillion rows table
:) select sum(price_cpm) from dw.ad8_fact_event where access_day=today()-1 and event_key=-2;
SELECT sum(price_cpm)
FROM dw.ad8_fact_event
WHERE (access_day = (today() - 1)) AND (event_key = -2)
┌────sum(price_cpm)─┐
│ 87579.09035192338 │
└───────────────────┘
1 rows in set. Elapsed: 0.168 sec. Processed 161.89 million rows, 2.91 GB (961.83 million
rows/s., 17.31 GB/s.)
Altinity Ltd. www.altinity.com
1+ trillion rows table
WikiStat data, 28B rows.
https://www.percona.com/blog/2017/03/17/column-store-database-benchmarks-mariadb-columnstore-vs-clickhouse-vs-apache-spark/
Query 1 Query 2 Query 3 Query 4 Setup
0.009 0.027 0.287 0.428 BrytlytDB 2.0 & 2-node p2.16xlarge cluster
0.034 0.061 0.178 0.498 MapD & 2-node p2.8xlarge cluster
0.051 0.146 0.047 0.794 kdb+/q & 4 Intel Xeon Phi 7210 CPUs
0.241 0.826 1.209 1.781 ClickHouse, 3 x c5d.9xlarge cluster
0.762 2.472 4.131 6.041 BrytlytDB 1.0 & 2-node p2.16xlarge cluster
1.034 3.058 5.354 12.748 ClickHouse, Intel Core i5 4670K
1.56 1.25 2.25 2.97 Redshift, 6-node ds2.8xlarge cluster
2 2 1 3 BigQuery
2.362 3.559 4.019 20.412 Spark 2.4 & 21 x m3.xlarge HDFS cluster
6.41 6.19 6.09 6.63 Amazon Athena
8.1 18.18 n/a n/a Elasticsearch (heavily tuned)
14.389 32.148 33.448 67.312 Vertica, Intel Core i5 4670K
22 25 27 65 Spark 2.3.0 & single i3.8xlarge w/ HDFS
35 39 64 81 Presto, 5-node m3.xlarge cluster w/ HDFS
152 175 235 368 PostgreSQL 9.5 & cstore_fdw
“1.1 Billion Taxi Rides Benchmarks” http://tech.marksblogg.com/benchmarks.html
“This is the first time a free CPU-based database has managed to out-perform a GPU-based database in my
benchmarks.” Mark Litwintschik
Time Series Benchmarks
• https://github.com/timescale/tsbs
• Benchmark suite to automate testing
• Loads 103M rows, 10 metrics per row
• Runs 15 queries, 1000 runs each in 8 parallel threads
• Supports TimescaleDB, InfluxDB, Cassandra, MongoDB and
ClickHouse (Altinity PR is submitted)
0
100
200
300
400
500
600
700
800
900
ClickHouse TimescaleDB InfluxDB
Load time (s)
1.20
26
0.46
0.00
5.00
10.00
15.00
20.00
25.00
30.00
ClickHouse TimescaleDB InfluxDB
Data Size on disk (GB)
0
10
20
30
40
50
60
70
80
“Light” queries, time in ms
ClickHouse
TimescaleDB
InfluxDB
0
10
20
30
40
50
60
70
80
90
“Heavy” queries, time in sec
ClickHouse
TimescaleDB
InfluxDB
How Flexible?
ClickHouse runs at
• Bare metal (any Linux)
• Public clouds: Amazon, Azure, Google, Alibaba
• Private clouds
• Docker, Kubernetes
ClickHouse solves business problems at:
• Mobile App and Web analytics
• AdTech
• Retail and E-Commerce
• Operational Logs analytics
• Telecom/Monitoring
• Financial Markets analytics
• Security Audit
• BlockChain transactions analysis
ClickHouse Migrations
Size does not matter
Yandex: 500+ servers, 25B rec/day
LifeStreet: 60 servers, 100B rec/day
CloudFlare: 76 servers, 200B rec/day
Bloomberg: 102 servers, 1000B rec/day
Toutiao: 1000 servers
How fun ☺
life←{↑1 ω∨.∧3 4=+/,¯1 0 1∘.⊖¯1 0 1∘.⌽⊂ω}
with (select groupArray(C) from C) as Ca
select id,
groupArray(S) Sa, groupArray(V) Va, groupArray(D) Da, groupArray(P) Pa,
arrayMap(c -> arrayFirstIndex(s -> s > c, Sa)-1, Ca) Ka,
arrayMap((c,k) -> Va[k] + (Va[k+1] - Va[k])/(Sa[k+1] - Sa[k])*(c-
Sa[k]),Ca,Ka) Ta,
arrayMap(s -> arrayFirstIndex(c -> c>s, Ca)>0 ? arrayFirstIndex(c ->
c>s, Ca)-1 : toInt32(length(Ca)), Sa) Ja,
arrayMap(i -> Ta[i], Ja) Ra,
arrayMap((v,r) -> v - r, Va, Ra) ARa,
arraySum((x,y,z) -> x*y*z, ARa, Da, Pa) result
from T group by id
What’s new in 2019
… Alexey Milovidov will disclose latest coolest features in 15 minutes
More user friendly than ever!
• GDPR compliance – thanks to UPDATE/DELETE
• Easier BI integration – thanks to SQL compatibility changes and
improvements in ODBC driver
• Easier cluster operation – thanks to clickhouse-copier, distributed DDL and
upcoming Altinity ClickHouse operator for Kubernetes
• Easier integration with other systems. Thanks to:
• HTTP/TCP protocols
• Table functions to access external data
• Kafka storage engine
• Logs integration with Logstash, ClickTail and other tools
• Integration wth MySQL, PostgreSQL
Integrates with MySQL
• mysql() table function
• MySQL table engine
• MySQL external dictionaries
• ProxySQL
• Binary log replication with clickhouse-mysql
mysql() table function
select * from mysql('host:port', database, 'table', 'user', 'password');
https://www.altinity.com/blog/2018/2/12/aggregate-mysql-data-at-high-speed-with-clickhouse
• Easiest and fastest way to get data from MySQL
• Load to CH table and run queries much faster
MySQL table engine
CREATE TABLE …
Engine = MySQL('host:port', 'database', 'table', 'user',
'password'[, replace_query, 'on_duplicate_clause']);
• SELECTs and INSERTs!
• No caching, data is queried from th remote server
https://clickhouse.yandex/docs/en/operations/table_engines/mysql/
MySQL external dictionaries
• Makes data from mysql database accessible in ClickHouse queries
• Stores in memory
• Updates when the source data changes
SELECT dictGet(‘dim_geo’, ‘country_name’, geo_key)
country_name,sum(imps)
FROM T
GROUP BY country_name;
Binary log replication from MySQL
to ClickHouse
MySQL
clickhouse-mysql
Queries
Source Data
See details at:
https://www.altinity.com/blog/2018/6/30/realtime-mysql-clickhouse-replication-in-practice
Integrates with PostgreSQL
• odbc() table function
• ODBC engine
• ODBC dictionaries
• PostgreSQL foreign data wrapper – clickhouse_fwd by Percona
• pg2ch -- binary log replication, Murat Kibilov will present later today
hello-kubernetes.yaml:
apiVersion: "clickhouse.altinity.com/v1"
kind: "ClickHouseInstallation"
metadata:
name: "hello-kubernetes"
spec:
configuration:
clusters:
- name: "sharded"
layout:
type: Standard
shardsCount: 3
$ kubectl -n test apply -f docs/examples/hello-kubernetes.yaml
clickhouseinstallation.clickhouse.altinity.com/hello-kubernetes created
$ kubectl -n test get services
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S)
AGE
chi-a9cffb-347e-0-0 ClusterIP None <none>
8123/TCP,9000/TCP,9009/TCP 7s
chi-a9cffb-347e-1-0 ClusterIP None <none>
8123/TCP,9000/TCP,9009/TCP 7s
chi-a9cffb-347e-2-0 ClusterIP None <none>
8123/TCP,9000/TCP,9009/TCP 7s
clickhouse-example-02 LoadBalancer 10.98.156.78 <pending>
8123:30703/TCP,9000:30348/TCP 7s
$ docker run -it yandex/clickhouse-client clickhouse-client -h 10.98.156.78
ClickHouse client version 19.1.14.
Connecting to 10.98.156.78:9000.
Connected to ClickHouse server version 19.1.14 revision 54413.
chi-a9cffb-347e-1-0-0.chi-a9cffb-347e-1-0.test.svc.cluster.local :)
chi-a9cffb-347e-1-0-0.chi-a9cffb-347e-1-0.test.svc.cluster.local :) create table
test_distr as system.one Engine = Distributed('sharded', system, one);
CREATE TABLE test_distr AS system.one
ENGINE = Distributed('sharded', system, one)
Ok.
0 rows in set. Elapsed: 0.016 sec.
chi-a9cffb-347e-1-0-0.chi-a9cffb-347e-1-0.test.svc.cluster.local :) select * from
test_distr;
SELECT *
FROM test_distr
┌─dummy─┐
│ 0 │
└───────┘
┌─dummy─┐
│ 0 │
└───────┘
┌─dummy─┐
│ 0 │
└───────┘
3 rows in set. Elapsed: 0.054 sec.
…coming soon
• Managing persistent volumes to be used for ClickHouse data
• Configuring pod deployment (pod templates, affinity rules and so on)
• Creating replicated tables
• Managing users/profiles configuration
• Exporting ClickHouse metrics to Prometheus
• Handling ClickHouse version upgrades
… and more
ClickHouse Today
• Mature Analytic DBMS. Proven by many companies
• Almost 3+ years in Open Source
• Constantly improves
• Solid community
• Emerging eco-system
• Support from Altinity
Q&A
Contact me:
alz@altinity.com
skype: alex.zaitsev
telegram: @alexanderzaitsev
Altinity

More Related Content

PDF
All About JSON and ClickHouse - Tips, Tricks and New Features-2022-07-26-FINA...
PDF
ClickHouse Query Performance Tips and Tricks, by Robert Hodges, Altinity CEO
PDF
ClickHouse Monitoring 101: What to monitor and how
PDF
10 Good Reasons to Use ClickHouse
PDF
ClickHouse Keeper
PDF
ClickHouse Deep Dive, by Aleksei Milovidov
PDF
A day in the life of a click house query
PDF
ClickHouse in Real Life. Case Studies and Best Practices, by Alexander Zaitsev
All About JSON and ClickHouse - Tips, Tricks and New Features-2022-07-26-FINA...
ClickHouse Query Performance Tips and Tricks, by Robert Hodges, Altinity CEO
ClickHouse Monitoring 101: What to monitor and how
10 Good Reasons to Use ClickHouse
ClickHouse Keeper
ClickHouse Deep Dive, by Aleksei Milovidov
A day in the life of a click house query
ClickHouse in Real Life. Case Studies and Best Practices, by Alexander Zaitsev

What's hot (20)

PDF
Better than you think: Handling JSON data in ClickHouse
PDF
Tricks every ClickHouse designer should know, by Robert Hodges, Altinity CEO
PDF
Altinity Quickstart for ClickHouse
PDF
A Day in the Life of a ClickHouse Query Webinar Slides
PDF
ClickHouse Intro
PDF
Using ClickHouse for Experimentation
PPTX
Migration to ClickHouse. Practical guide, by Alexander Zaitsev
PDF
ClickHouse Introduction, by Alexander Zaitsev, Altinity CTO
PDF
All about Zookeeper and ClickHouse Keeper.pdf
PDF
Analytics at Speed: Introduction to ClickHouse and Common Use Cases. By Mikha...
PPTX
High Performance, High Reliability Data Loading on ClickHouse
PDF
What is new in PostgreSQL 14?
PDF
Deep Dive on ClickHouse Sharding and Replication-2202-09-22.pdf
PDF
Your first ClickHouse data warehouse
PDF
ClickHouse Data Warehouse 101: The First Billion Rows, by Alexander Zaitsev a...
PDF
DB Time, Average Active Sessions, and ASH Math - Oracle performance fundamentals
PDF
One PDB to go, please!
PDF
Understanding oracle rac internals part 2 - slides
PDF
Oracle db performance tuning
PDF
Tanel Poder - Troubleshooting Complex Oracle Performance Issues - Part 1
Better than you think: Handling JSON data in ClickHouse
Tricks every ClickHouse designer should know, by Robert Hodges, Altinity CEO
Altinity Quickstart for ClickHouse
A Day in the Life of a ClickHouse Query Webinar Slides
ClickHouse Intro
Using ClickHouse for Experimentation
Migration to ClickHouse. Practical guide, by Alexander Zaitsev
ClickHouse Introduction, by Alexander Zaitsev, Altinity CTO
All about Zookeeper and ClickHouse Keeper.pdf
Analytics at Speed: Introduction to ClickHouse and Common Use Cases. By Mikha...
High Performance, High Reliability Data Loading on ClickHouse
What is new in PostgreSQL 14?
Deep Dive on ClickHouse Sharding and Replication-2202-09-22.pdf
Your first ClickHouse data warehouse
ClickHouse Data Warehouse 101: The First Billion Rows, by Alexander Zaitsev a...
DB Time, Average Active Sessions, and ASH Math - Oracle performance fundamentals
One PDB to go, please!
Understanding oracle rac internals part 2 - slides
Oracle db performance tuning
Tanel Poder - Troubleshooting Complex Oracle Performance Issues - Part 1
Ad

Similar to ClickHouse Introduction by Alexander Zaitsev, Altinity CTO (20)

PDF
ClickHouse 2018. How to stop waiting for your queries to complete and start ...
PDF
ClickHouse Analytical DBMS. Introduction and usage, by Alexander Zaitsev
PDF
Databases Have Forgotten About Single Node Performance, A Wrongheaded Trade Off
PDF
MySQL 开发
PDF
C* for Deep Learning (Andrew Jefferson, Tracktable) | Cassandra Summit 2016
PDF
What is MariaDB Server 10.3?
PDF
Using ScyllaDB for Extreme Scale Workloads
PPTX
Jump Start with Apache Spark 2.0 on Databricks
PPTX
ETL with SPARK - First Spark London meetup
PDF
Using Apache Spark and MySQL for Data Analysis
PDF
Introduction to Apache Cassandra
PPTX
Letgo Data Platform: A global overview
PDF
Quick Wins
PPTX
Image Recognition on Streaming Data
PDF
A Rusty introduction to Apache Arrow and how it applies to a time series dat...
PPTX
DAC4B 2015 - Polybase
PDF
Webinar slides: Adding Fast Analytics to MySQL Applications with Clickhouse
PPTX
Presentation
PDF
Presto talk @ Global AI conference 2018 Boston
PDF
Scylla Summit 2016: Analytics Show Time - Spark and Presto Powered by Scylla
ClickHouse 2018. How to stop waiting for your queries to complete and start ...
ClickHouse Analytical DBMS. Introduction and usage, by Alexander Zaitsev
Databases Have Forgotten About Single Node Performance, A Wrongheaded Trade Off
MySQL 开发
C* for Deep Learning (Andrew Jefferson, Tracktable) | Cassandra Summit 2016
What is MariaDB Server 10.3?
Using ScyllaDB for Extreme Scale Workloads
Jump Start with Apache Spark 2.0 on Databricks
ETL with SPARK - First Spark London meetup
Using Apache Spark and MySQL for Data Analysis
Introduction to Apache Cassandra
Letgo Data Platform: A global overview
Quick Wins
Image Recognition on Streaming Data
A Rusty introduction to Apache Arrow and how it applies to a time series dat...
DAC4B 2015 - Polybase
Webinar slides: Adding Fast Analytics to MySQL Applications with Clickhouse
Presentation
Presto talk @ Global AI conference 2018 Boston
Scylla Summit 2016: Analytics Show Time - Spark and Presto Powered by Scylla
Ad

More from Altinity Ltd (20)

PPTX
Building an Analytic Extension to MySQL with ClickHouse and Open Source.pptx
PDF
Cloud Native ClickHouse at Scale--Using the Altinity Kubernetes Operator-2022...
PPTX
Building an Analytic Extension to MySQL with ClickHouse and Open Source
PDF
Fun with ClickHouse Window Functions-2021-08-19.pdf
PDF
Cloud Native Data Warehouses - Intro to ClickHouse on Kubernetes-2021-07.pdf
PDF
Building High Performance Apps with Altinity Stable Builds for ClickHouse | A...
PDF
Application Monitoring using Open Source - VictoriaMetrics & Altinity ClickHo...
PDF
Own your ClickHouse data with Altinity.Cloud Anywhere-2023-01-17.pdf
PDF
ClickHouse ReplacingMergeTree in Telecom Apps
PDF
Adventures with the ClickHouse ReplacingMergeTree Engine
PDF
Building a Real-Time Analytics Application with Apache Pulsar and Apache Pinot
PDF
Altinity Webinar: Introduction to Altinity.Cloud-Platform for Real-Time Data.pdf
PDF
OSA Con 2022 - What Data Engineering Can Learn from Frontend Engineering - Pe...
PDF
OSA Con 2022 - Welcome to OSA CON Version 2022 - Robert Hodges - Altinity.pdf
PDF
OSA Con 2022 - Using ClickHouse Database to Power Analytics and Customer Enga...
PDF
OSA Con 2022 - Tips and Tricks to Keep Your Queries under 100ms with ClickHou...
PDF
OSA Con 2022 - The Open Source Analytic Universe, Version 2022 - Robert Hodge...
PDF
OSA Con 2022 - Switching Jaeger Distributed Tracing to ClickHouse to Enable A...
PDF
OSA Con 2022 - Streaming Data Made Easy - Tim Spann & David Kjerrumgaard - St...
PDF
OSA Con 2022 - State of Open Source Databases - Peter Zaitsev - Percona.pdf
Building an Analytic Extension to MySQL with ClickHouse and Open Source.pptx
Cloud Native ClickHouse at Scale--Using the Altinity Kubernetes Operator-2022...
Building an Analytic Extension to MySQL with ClickHouse and Open Source
Fun with ClickHouse Window Functions-2021-08-19.pdf
Cloud Native Data Warehouses - Intro to ClickHouse on Kubernetes-2021-07.pdf
Building High Performance Apps with Altinity Stable Builds for ClickHouse | A...
Application Monitoring using Open Source - VictoriaMetrics & Altinity ClickHo...
Own your ClickHouse data with Altinity.Cloud Anywhere-2023-01-17.pdf
ClickHouse ReplacingMergeTree in Telecom Apps
Adventures with the ClickHouse ReplacingMergeTree Engine
Building a Real-Time Analytics Application with Apache Pulsar and Apache Pinot
Altinity Webinar: Introduction to Altinity.Cloud-Platform for Real-Time Data.pdf
OSA Con 2022 - What Data Engineering Can Learn from Frontend Engineering - Pe...
OSA Con 2022 - Welcome to OSA CON Version 2022 - Robert Hodges - Altinity.pdf
OSA Con 2022 - Using ClickHouse Database to Power Analytics and Customer Enga...
OSA Con 2022 - Tips and Tricks to Keep Your Queries under 100ms with ClickHou...
OSA Con 2022 - The Open Source Analytic Universe, Version 2022 - Robert Hodge...
OSA Con 2022 - Switching Jaeger Distributed Tracing to ClickHouse to Enable A...
OSA Con 2022 - Streaming Data Made Easy - Tim Spann & David Kjerrumgaard - St...
OSA Con 2022 - State of Open Source Databases - Peter Zaitsev - Percona.pdf

Recently uploaded (20)

PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
KodekX | Application Modernization Development
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Spectral efficient network and resource selection model in 5G networks
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PPTX
MYSQL Presentation for SQL database connectivity
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PPTX
Big Data Technologies - Introduction.pptx
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
Machine learning based COVID-19 study performance prediction
PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Building Integrated photovoltaic BIPV_UPV.pdf
KodekX | Application Modernization Development
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Spectral efficient network and resource selection model in 5G networks
Digital-Transformation-Roadmap-for-Companies.pptx
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Network Security Unit 5.pdf for BCA BBA.
Dropbox Q2 2025 Financial Results & Investor Presentation
MYSQL Presentation for SQL database connectivity
Understanding_Digital_Forensics_Presentation.pptx
Mobile App Security Testing_ A Comprehensive Guide.pdf
The Rise and Fall of 3GPP – Time for a Sabbatical?
Big Data Technologies - Introduction.pptx
20250228 LYD VKU AI Blended-Learning.pptx
Unlocking AI with Model Context Protocol (MCP)
Chapter 3 Spatial Domain Image Processing.pdf
Machine learning based COVID-19 study performance prediction
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
Build a system with the filesystem maintained by OSTree @ COSCUP 2025

ClickHouse Introduction by Alexander Zaitsev, Altinity CTO

  • 1. 18:15 Opening word (Javier Santana) 18:25 ClickHouse introduction (Alexander Zaitsev, Altinity) 19:00 ClickHouse 2019 new features (Alexey Milovidov, Yandex) 19:40 Coffee break 20:00 From legacy to ClickHouse (Iago Enriquez, Idealista) 20:25 1027 predictive models in 10 seconds (David Pardo Villaverde, Corunet) 21:55 Shipping Data from Postgres to Clickhouse (Murat Kabilov, Adjust) 21:20 More Q&A and closing remarks 21:30 Networking, beer etc.
  • 4. ClickHouse DBMS is Column Store MPP Realtime SQL Open Source
  • 5. http://clickhouse.yandex • Developed by Yandex for Yandex.Metrica • Yandex (NASDAQ: YNDX) – “Russian Google” (50% market share in search, 50+ b2b and b2c products) • Yandex.Metrica – world 2nd largest web analytics platform • Open Source since June 2016 (Apache 2.0 license) • 200+ companies using in production today • Several hundred experimenting, doing POC etc. • Dozens of contributors to the source code
  • 10. :) select count(*) from dw.ad8_fact_event; SELECT count(*) FROM dw.ad8_fact_event ┌───────count()─┐ │ 1261705085657 │ └───────────────┘ 1 rows in set. Elapsed: 3.552 sec. Processed 1.26 trillion rows, 1.26 TB (355.22 billion rows/s., 355.22 GB/s.) Altinity Ltd. www.altinity.com 1+ trillion rows table
  • 11. :) select sum(price_cpm) from dw.ad8_fact_event where access_day=today()-1 and event_key=-2; SELECT sum(price_cpm) FROM dw.ad8_fact_event WHERE (access_day = (today() - 1)) AND (event_key = -2) ┌────sum(price_cpm)─┐ │ 87579.09035192338 │ └───────────────────┘ 1 rows in set. Elapsed: 0.168 sec. Processed 161.89 million rows, 2.91 GB (961.83 million rows/s., 17.31 GB/s.) Altinity Ltd. www.altinity.com 1+ trillion rows table
  • 12. WikiStat data, 28B rows. https://www.percona.com/blog/2017/03/17/column-store-database-benchmarks-mariadb-columnstore-vs-clickhouse-vs-apache-spark/
  • 13. Query 1 Query 2 Query 3 Query 4 Setup 0.009 0.027 0.287 0.428 BrytlytDB 2.0 & 2-node p2.16xlarge cluster 0.034 0.061 0.178 0.498 MapD & 2-node p2.8xlarge cluster 0.051 0.146 0.047 0.794 kdb+/q & 4 Intel Xeon Phi 7210 CPUs 0.241 0.826 1.209 1.781 ClickHouse, 3 x c5d.9xlarge cluster 0.762 2.472 4.131 6.041 BrytlytDB 1.0 & 2-node p2.16xlarge cluster 1.034 3.058 5.354 12.748 ClickHouse, Intel Core i5 4670K 1.56 1.25 2.25 2.97 Redshift, 6-node ds2.8xlarge cluster 2 2 1 3 BigQuery 2.362 3.559 4.019 20.412 Spark 2.4 & 21 x m3.xlarge HDFS cluster 6.41 6.19 6.09 6.63 Amazon Athena 8.1 18.18 n/a n/a Elasticsearch (heavily tuned) 14.389 32.148 33.448 67.312 Vertica, Intel Core i5 4670K 22 25 27 65 Spark 2.3.0 & single i3.8xlarge w/ HDFS 35 39 64 81 Presto, 5-node m3.xlarge cluster w/ HDFS 152 175 235 368 PostgreSQL 9.5 & cstore_fdw “1.1 Billion Taxi Rides Benchmarks” http://tech.marksblogg.com/benchmarks.html “This is the first time a free CPU-based database has managed to out-perform a GPU-based database in my benchmarks.” Mark Litwintschik
  • 14. Time Series Benchmarks • https://github.com/timescale/tsbs • Benchmark suite to automate testing • Loads 103M rows, 10 metrics per row • Runs 15 queries, 1000 runs each in 8 parallel threads • Supports TimescaleDB, InfluxDB, Cassandra, MongoDB and ClickHouse (Altinity PR is submitted)
  • 17. 0 10 20 30 40 50 60 70 80 “Light” queries, time in ms ClickHouse TimescaleDB InfluxDB
  • 18. 0 10 20 30 40 50 60 70 80 90 “Heavy” queries, time in sec ClickHouse TimescaleDB InfluxDB
  • 20. ClickHouse runs at • Bare metal (any Linux) • Public clouds: Amazon, Azure, Google, Alibaba • Private clouds • Docker, Kubernetes
  • 21. ClickHouse solves business problems at: • Mobile App and Web analytics • AdTech • Retail and E-Commerce • Operational Logs analytics • Telecom/Monitoring • Financial Markets analytics • Security Audit • BlockChain transactions analysis
  • 23. Size does not matter Yandex: 500+ servers, 25B rec/day LifeStreet: 60 servers, 100B rec/day CloudFlare: 76 servers, 200B rec/day Bloomberg: 102 servers, 1000B rec/day Toutiao: 1000 servers
  • 24. How fun ☺ life←{↑1 ω∨.∧3 4=+/,¯1 0 1∘.⊖¯1 0 1∘.⌽⊂ω}
  • 25. with (select groupArray(C) from C) as Ca select id, groupArray(S) Sa, groupArray(V) Va, groupArray(D) Da, groupArray(P) Pa, arrayMap(c -> arrayFirstIndex(s -> s > c, Sa)-1, Ca) Ka, arrayMap((c,k) -> Va[k] + (Va[k+1] - Va[k])/(Sa[k+1] - Sa[k])*(c- Sa[k]),Ca,Ka) Ta, arrayMap(s -> arrayFirstIndex(c -> c>s, Ca)>0 ? arrayFirstIndex(c -> c>s, Ca)-1 : toInt32(length(Ca)), Sa) Ja, arrayMap(i -> Ta[i], Ja) Ra, arrayMap((v,r) -> v - r, Va, Ra) ARa, arraySum((x,y,z) -> x*y*z, ARa, Da, Pa) result from T group by id
  • 26. What’s new in 2019 … Alexey Milovidov will disclose latest coolest features in 15 minutes
  • 27. More user friendly than ever! • GDPR compliance – thanks to UPDATE/DELETE • Easier BI integration – thanks to SQL compatibility changes and improvements in ODBC driver • Easier cluster operation – thanks to clickhouse-copier, distributed DDL and upcoming Altinity ClickHouse operator for Kubernetes • Easier integration with other systems. Thanks to: • HTTP/TCP protocols • Table functions to access external data • Kafka storage engine • Logs integration with Logstash, ClickTail and other tools • Integration wth MySQL, PostgreSQL
  • 28. Integrates with MySQL • mysql() table function • MySQL table engine • MySQL external dictionaries • ProxySQL • Binary log replication with clickhouse-mysql
  • 29. mysql() table function select * from mysql('host:port', database, 'table', 'user', 'password'); https://www.altinity.com/blog/2018/2/12/aggregate-mysql-data-at-high-speed-with-clickhouse • Easiest and fastest way to get data from MySQL • Load to CH table and run queries much faster
  • 30. MySQL table engine CREATE TABLE … Engine = MySQL('host:port', 'database', 'table', 'user', 'password'[, replace_query, 'on_duplicate_clause']); • SELECTs and INSERTs! • No caching, data is queried from th remote server https://clickhouse.yandex/docs/en/operations/table_engines/mysql/
  • 31. MySQL external dictionaries • Makes data from mysql database accessible in ClickHouse queries • Stores in memory • Updates when the source data changes SELECT dictGet(‘dim_geo’, ‘country_name’, geo_key) country_name,sum(imps) FROM T GROUP BY country_name;
  • 32. Binary log replication from MySQL to ClickHouse MySQL clickhouse-mysql Queries Source Data See details at: https://www.altinity.com/blog/2018/6/30/realtime-mysql-clickhouse-replication-in-practice
  • 33. Integrates with PostgreSQL • odbc() table function • ODBC engine • ODBC dictionaries • PostgreSQL foreign data wrapper – clickhouse_fwd by Percona • pg2ch -- binary log replication, Murat Kibilov will present later today
  • 34. hello-kubernetes.yaml: apiVersion: "clickhouse.altinity.com/v1" kind: "ClickHouseInstallation" metadata: name: "hello-kubernetes" spec: configuration: clusters: - name: "sharded" layout: type: Standard shardsCount: 3
  • 35. $ kubectl -n test apply -f docs/examples/hello-kubernetes.yaml clickhouseinstallation.clickhouse.altinity.com/hello-kubernetes created $ kubectl -n test get services NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE chi-a9cffb-347e-0-0 ClusterIP None <none> 8123/TCP,9000/TCP,9009/TCP 7s chi-a9cffb-347e-1-0 ClusterIP None <none> 8123/TCP,9000/TCP,9009/TCP 7s chi-a9cffb-347e-2-0 ClusterIP None <none> 8123/TCP,9000/TCP,9009/TCP 7s clickhouse-example-02 LoadBalancer 10.98.156.78 <pending> 8123:30703/TCP,9000:30348/TCP 7s
  • 36. $ docker run -it yandex/clickhouse-client clickhouse-client -h 10.98.156.78 ClickHouse client version 19.1.14. Connecting to 10.98.156.78:9000. Connected to ClickHouse server version 19.1.14 revision 54413. chi-a9cffb-347e-1-0-0.chi-a9cffb-347e-1-0.test.svc.cluster.local :)
  • 37. chi-a9cffb-347e-1-0-0.chi-a9cffb-347e-1-0.test.svc.cluster.local :) create table test_distr as system.one Engine = Distributed('sharded', system, one); CREATE TABLE test_distr AS system.one ENGINE = Distributed('sharded', system, one) Ok. 0 rows in set. Elapsed: 0.016 sec.
  • 38. chi-a9cffb-347e-1-0-0.chi-a9cffb-347e-1-0.test.svc.cluster.local :) select * from test_distr; SELECT * FROM test_distr ┌─dummy─┐ │ 0 │ └───────┘ ┌─dummy─┐ │ 0 │ └───────┘ ┌─dummy─┐ │ 0 │ └───────┘ 3 rows in set. Elapsed: 0.054 sec.
  • 39. …coming soon • Managing persistent volumes to be used for ClickHouse data • Configuring pod deployment (pod templates, affinity rules and so on) • Creating replicated tables • Managing users/profiles configuration • Exporting ClickHouse metrics to Prometheus • Handling ClickHouse version upgrades … and more
  • 40. ClickHouse Today • Mature Analytic DBMS. Proven by many companies • Almost 3+ years in Open Source • Constantly improves • Solid community • Emerging eco-system • Support from Altinity