SlideShare una empresa de Scribd logo
1 de 62
Descargar para leer sin conexión
© 2021 Altinity, Inc.
Altinity Quickstart
for ClickHouse
Creating your first application
1
Version 2022-01
© 2021 Altinity, Inc.
Let’s make some introductions
ClickHouse support and services including Altinity.Cloud
Authors of Altinity Kubernetes Operator for ClickHouse
and other open source projects
Us
Database geeks with centuries
of experience in DBMS and
applications
You
Applications developers
looking to learn about
ClickHouse
2
© 2021 Altinity, Inc.
© 2021 Altinity, Inc.
What’s a
ClickHouse?
3
© 2021 Altinity, Inc.
Understands SQL
Runs on bare metal to cloud
Shared nothing architecture
Stores data in columns
Parallel and vectorized execution
Scales to many petabytes
Is Open source (Apache 2.0)
ClickHouse is a SQL Data Warehouse
It’s the core engine for
real-time analytics
ClickHouse
Event
Streams
ELT
Object
Storage
Interactive
Graphics
Dashboards
APIs
4
© 2021 Altinity, Inc.
What ClickHouse Is Not…
ClickHouse does not have full
ACID transactions and
updates are slow
ClickHouse is designed to read large
blocks of data for a few users
ClickHouse values speed over SQL
standards and runs anywhere
5
© 2021 Altinity, Inc.
ClickHouse stores data in columns, not rows
Carrier FlightDate TailNum ... Cancelled Delayed
Carrier FlightDate TailNum ... Cancelled Delayed
Carrier FlightDate TailNum ... Cancelled Delayed
Carrier FlightDate TailNum ... Cancelled Delayed
Carrier FlightDate TailNum ... Cancelled Delayed
Dimensions… Measurements…
Sort
Ordering
6
© 2021 Altinity, Inc.
It compresses data and has great parallel query
59 GB
(100%)
21 MB
(.035%)
2.6 MB
(.0044%)
1.7 GB
(3%)
Read all
columns
Read 3
columns
Read 3
compressed
columns
Read 3
compressed
columns over
8 threads
7
© 2021 Altinity, Inc.
© 2021 Altinity, Inc.
Installing
ClickHouse and
Connecting
8
© 2021 Altinity, Inc.
Install ClickHouse from a build repo
# Ubuntu example
sudo apt-get install -y clickhouse-server clickhouse-client
sudo systemctl start clickhouse-server
Altinity Stable Builds
Prod-ready LTS builds only
(3 years of support)
https://docs.altinity.com
ClickHouse Community Builds
Monthly builds
LTS builds every 6 months
(1 year of support)
https://clickhouse.com
9
© 2021 Altinity, Inc.
Install ClickHouse using Docker
mkdir $HOME/clickhouse-data
docker run -d --name clickhouse-server 
--ulimit nofile=262144:262144 
--volume=$HOME/clickhouse-data:/var/lib/clickhouse 
-p 8123:8123 -p 9000:9000 
yandex/clickhouse-server
10
Persist data
Make ports visible
Make ClickHouse happy
Altinity Stable Builds
Tag: altinity/clickhouse-server
ClickHouse Community Builds
Tag: yandex/clickhouse-server
© 2021 Altinity, Inc.
(Trials available)
● Altinity.Cloud -- Runs in AWS and GCP
● Yandex Managed Service for ClickHouse -- Runs in
Yandex.Cloud
Install ClickHouse in the cloud
11
© 2021 Altinity, Inc.
Connecting from the command line
-- Connect to ClickHouse running locally on your laptop.
clickhouse-client
-- Same thing with explicit options.
clickhouse-client 
--host=localhost 
--port=9000 --user=default
-- Connect to a secure ClickHouse running in the Cloud.
clickhouse-client 
--host=github.demo.altinity.cloud 
--port=9440 --secure 
--user=demo --password=demo
12
© 2021 Altinity, Inc.
Connecting to built-in web UI
URL Format: http[s]://host:port/play
Example: https://github.demo.altinity.cloud:8443/play (user=demo/pw=demo)
Example: http://localhost:8123/play (user=default/pw=null)
User Password
13
© 2021 Altinity, Inc.
© 2021 Altinity, Inc.
Finding your way
around
ClickHouse
14
© 2021 Altinity, Inc.
Databases and tables
● Every ClickHouse has databases and tables
● ClickHouse databases are like folders:
○ MySQL databases
○ PostgreSQL schemas
● Every connection has a “current” database
○ Tables in the current database don’t need a database name
15
© 2021 Altinity, Inc.
Handy commands for navigation
16
SQL Command What it does
show databases List databases in ClickHouse
select currentDatabase() What’s my current database?
show tables [from name] Show tables [in a particular database]
describe table name Show the structure of table
SELECT count() FROM ontime Select from table ontime in current database
SELECT count() FROM
anotherdb.ontime
Select from table ontime in database anotherdb
© 2021 Altinity, Inc.
Selecting the database
● clickhouse-client allows you to switch between databases in a session
clickhouse101 :) use system
Ok.
● Most APIs require you to set the database in the URL.
○ HTTP:
https://rhodges_59945:<pw>@clickhouse101.demo.altinity.cloud:8443?database=system
○ JDBC: jdbc:clickhouse://clickhouse101.demo.altinity.cloud:8443/rhodges_59945
○ Python SQLAlchemy:
clickhouse+native://demo:demo@github.demo.altinity.cloud/default?secure=true
17
© 2021 Altinity, Inc.
Special databases in ClickHouse
default -- Standard database for user data in a new ClickHouse installation
config.xml: <default_database>default</default_database>
system -- Database for system tables
SHOW TABLES FROM system
┌─name───────────────────────────┐
│ aggregate_function_combinators │
│ asynchronous_metric_log │
│ asynchronous_metrics │
│ build_options │
│ clusters │
│ collations │
│ columns │
18
Your friends :)
© 2021 Altinity, Inc.
© 2021 Altinity, Inc.
Creating Your
First Table and
Loading Data
19
© 2021 Altinity, Inc.
Let’s create a table!
CREATE TABLE IF NOT EXISTS sdata (
DevId Int32,
Type String,
MDate Date,
MDatetime DateTime,
Value Float64
) ENGINE = MergeTree()
PARTITION BY toYYYYMM(MDate)
ORDER BY (DevId, MDatetime)
20
Table engine type
How to break data into
parts
How to index and sort
data in each part
Table columns
© 2021 Altinity, Inc.
Let’s insert some data the hard way…
INSERT INTO sdata VALUES
(15, 'TEMP', '2018-01-01', '2018-01-01 23:29:55', 18.0),
(15, 'TEMP', '2018-01-01', '2018-01-01 23:30:56', 18.7)
21
OK, nobody really does this.
© 2021 Altinity, Inc.
Use input formats to load raw data
Format Description
Values Normal INSERT tuples like (‘a’, 1, 35.7)
CSV, CSVWithNames Comma-separated values, CSV with column names
JSONEachRow Single JSON record per row (many JSON formats supported)
Protobuf Google Protocol Buffers format
Avro, AvroConfluent Apache Avro and Confluent/Kafka variant
Parquet Apache Parquet columnar data format
ORC Apache ORC (another columnar format from Hadoop)
* Try this: select * from system.formats
* Or this: https://clickhouse.com/docs/en/interfaces/formats/
22
© 2021 Altinity, Inc.
DevId,Type,MDate,MDatetime,Value
59,"TEMP","2018-02-01","2018-02-01 01:10:13",19.5
59,"TEMP","2018-02-01","2018-02-01 02:10:01",18.8
59,"TEMP","2018-02-01","2018-02-01 03:09:58",18.6
59,"TEMP","2018-02-01","2018-02-01 04:10:05",15.1
59,"TEMP","2018-02-01","2018-02-01 05:10:31",12.2
23
cat sdata.csv | clickhouse-client 
--database=sense 
--query='INSERT INTO sdata FORMAT CSVWithNames'
Input file sdata.csv
Use clickhouse-client to load raw data from command line
© 2021 Altinity, Inc.
Or with HTTP commands
24
#!/bin/bash
insert='INSERT%20INTO%20sense.sdata%20Format%20CSVWithNames'
curl -v "http://localhost:8123/?query=${insert}" 
--data-binary @sdata.csv
Uses HTTP POST
Read data from file
© 2021 Altinity, Inc.
Or you could insert from S3
SET max_insert_threads=32
INSERT INTO sdata
SELECT * FROM s3(
'https://s3.us-east-1.amazonaws.com/d1-alt/d1/sdata*.csv.gz',
'aws_access_key_id',
'aws_secret_access_key',
'CSVWithNames',
'DevId Int32, Type String, MDate Date, MDatetime DateTime,
Value Float64')
Parallelize!
Read multiple files
Schema (Not
needed after 22.1)
Input format
25
© 2021 Altinity, Inc.
How to update and delete rows
ALTER TABLE ontime
UPDATE UniqueCarrier = 'OO2'
WHERE UniqueCarrier = 'OO'
ALTER TABLE ontime
DELETE WHERE UniqueCarrier = 'OO2'
26
Asynchronous
Different syntax
from standard SQL
Can be expensive!
© 2021 Altinity, Inc.
How to find out if update/delete has finished
SELECT command, is_done
FROM system.mutations
WHERE table = 'ontime'
┌─command─────────────────────────────────────────────────┬─is_done─┐
│ UPDATE UniqueCarrier = 'OO2' WHERE UniqueCarrier = 'OO' │ 1 │
│ DELETE WHERE UniqueCarrier = 'OO2' │ 1 │
└─────────────────────────────────────────────────────────┴─────────┘
KILL mutation WHERE table = 'ontime'
27
Tracks progress of “mutations”
Cancels mutation
© 2021 Altinity, Inc.
What’s going on down there when you INSERT?
Table
Part
Index Columns
Sparse index finds rows by DevId,
MDatetime
Columns sorted
by DevId,
MDatetime
Rows in the part
all belong to
same month
Part
Index Columns
Part 28
© 2021 Altinity, Inc.
Why MergeTree? Because it merges!
Part
Index Columns
Part
Index Columns
Rewritten, Bigger Part
Index Columns
29
Update and delete also rewrite parts
© 2021 Altinity, Inc.
Top three tips for table design and data loading
● Pick a PARTITION BY that gives nice, fat partitions ( 1-300GB, < 1000
total parts)
○ Can’t decide? Partition by month.
● Use input formats to load raw data directly
● Insert large blocks of data to avoid lots of merges afterwards
○ ClickHouse will default up to 1,048,576 rows in a single part. You can increase it
to tens of millions
30
© 2021 Altinity, Inc.
© 2021 Altinity, Inc.
Selecting Data
31
© 2021 Altinity, Inc.
SELECT allows us to fetch interesting data
32
© 2021 Altinity, Inc.
Who had the most cancelled flights in 2017?
SELECT Carrier,
toYear(FlightDate) AS Year,
sum(Cancelled)/count(*) * 100. AS cancelled
FROM ontime
WHERE Year = 2017
GROUP BY Carrier, Year
HAVING cancelled > 1.0
ORDER BY cancelled DESC
LIMIT 10
Dimensions Aggregate
Range Filter
Aggregate Filter
Order of results
Max results
33
© 2021 Altinity, Inc.
Rule #1 for selecting data in ClickHouse
34
Most SQL SELECT syntax
“just works” in ClickHouse
So what’s different?
© 2021 Altinity, Inc.
If you are using ClickHouse, time is probably important
Time series == Data with built-in time ordering
35
© 2021 Altinity, Inc.
Using time dimensions in queries
SELECT
toStartOfWeek(FlightDate) AS Week,
Carrier,
count() AS Flights
FROM default.ontime_ref
WHERE FlightDate BETWEEN toDate('2015-01-01')
AND toDate('2015-06-30')
GROUP BY Week, Carrier
ORDER BY Carrier, Week
36
© 2021 Altinity, Inc.
ClickHouse has excellent date-time support
Date -- Precision to day
DateTime -- Precision to second
DateTime64 -- Precision to
nanosecond
toYear(), toMonth(), toWeek(), toDayOfWeek,
toDay(), toHour(), ...
toStartOfYear(), toStartOfQuarter(),
toStartOfMonth(), toStartOfHour(),
toStartOfMinute(), …, toStartOfInterval()
toYYYYMM()
toYYYYMMDD()
toYYYYMMDDhhmmsss()
And many more!
37
BI tools like Grafana like
DateTime values
© 2021 Altinity, Inc.
ClickHouse has a very rich set of aggregates, too
38
Standard SQL aggregation functions
● count()
● avg()
● sum()
● min()
● max()
And many more native to ClickHouse
● any()
● anyLast()
● avgWeighted()
● uniq()
● uniqExact()
● quantile()
● quantileExact()
● simpleLinearRegression()
● groupArray()
● …
© 2021 Altinity, Inc.
Drilling into GROUP BY syntax
SELECT Carrier,
toYear(FlightDate) AS Year,
count() AS TotalFlights,
sum(Cancelled) AS TotalCancelled
FROM ontime
GROUP BY Carrier, Year
Dimensions
Every thing
else must be
an aggregate
Dimensions must
be in GROUP BY
39
© 2021 Altinity, Inc.
Another example: find “Top N”with ORDER BY and LIMIT
SELECT o.Origin,
any(o.OriginCityName) AS OriginCityName,
any(o.OriginState) AS OriginState,
COUNT() as Flights
FROM ontime o
GROUP BY Origin
ORDER BY Flights DESC
LIMIT 10
Correlated
values
Measure
Dimension
40
© 2021 Altinity, Inc.
JOIN combines data between tables
SELECT o.Dest,
any(a.Name) AS AirportName,
count(Dest) AS Flights
FROM ontime o
LEFT JOIN airports a ON a.IATA = toString(o.Dest)
GROUP BY Dest
ORDER BY Flights
DESC LIMIT 10
41
Join condition
Join
type
Include ontime data
even if we can’t find
the airport name
© 2021 Altinity, Inc.
Let’s look more closely at joins
. . .
IATA
. . .
airports
. . .
Dest
. . .
ontime
LEFT [OUTER] JOIN FULL [OUTER] JOIN
RIGHT [OUTER] JOIN
All ontime rows, plus
matching airport rows
All airport rows, plus
matching ontime rows
[INNER] JOIN
Only rows that match on both sides
Matching rows, plus non-matching
rows from both sides
CROSS JOIN
Matches all rows with each
other. Aka “cartesian join”
SELECT . . . FROM ontime o JOIN airports a ON a.IATA = toString(o.Dest)
42
Left Right
© 2021 Altinity, Inc.
You can check this yourself with sample tables
Table Left
id value
1 Left
2 Left
Table Right
id value
2 Right
3 Right
SELECT l.id, l.value, r.id, r.value
FROM left AS l INNER JOIN right AS r ON l.id = r.id
Id value id value
2 Left 2 Right
Id value id value
1 Left 0 -
2 Left 2 Right
Id value id value
2 Left 2 Right
0 - 3 Right
Id value id value
1 Left 0 -
2 Left 2 Right
0 - 3 Right
[INNER] JOIN
LEFT [OUTER] JOIN FULL [OUTER] JOIN RIGHT [OUTER] JOIN
43
© 2021 Altinity, Inc.
How does ClickHouse process a query with a join?
Left Side
Table
(Big)
Merged
Result
Filter
Right Side
Table
(Small)
In-RAM
Hash
Table
Load the right side table
Scan left side table in
parallel, computing
aggregates and adding
joined data
Merge and sort results
44
© 2021 Altinity, Inc.
Top three tips for querying data in ClickHouse
● Use time functions to pull out data grouped by time intervals
● Use aggregates to summarize data inside ClickHouse
● The big table always goes on the LEFT side of the join
○ ClickHouse cannot decide the join order [yet] for you
45
© 2021 Altinity, Inc.
© 2021 Altinity, Inc.
ClickHouse
Performance Basic
Self-Defense
46
© 2021 Altinity, Inc.
ClickHouse performance in four easy steps
● Add more CPU
● Limit columns and rows in queries
● Fix table design
● Store data more efficiently on disk (or SSD)
47
© 2021 Altinity, Inc.
Add more compute using max_threads property
SELECT toYear(FlightDate) year,
sum(Cancelled)/count(*) cancelled,
sum(DepDel15)/count(*) delayed_15
FROM airline.ontime
GROUP BY year ORDER BY year LIMIT 10
SET max_threads = 2
SET max_threads = 4
. . .
max_threads defaults to half
the number of CPU cores
48
© 2021 Altinity, Inc.
(Log messages)
Selected 2 parts by date,
2 parts by key,
73 marks to read from 2 ranges
Read fewer rows to get better performance
SELECT
FlightDate,
count(*) AS total_flights,
sum(Cancelled) / count(*) AS cancelled,
sum(DepDel15) / count(*) AS delayed_15
FROM airline.ontime
WHERE (FlightDate >= toDate('2016-01-01'))
AND (FlightDate <= toDate('2016-02-10'))
GROUP BY FlightDate
49
© 2021 Altinity, Inc.
Understanding what’s going on in MergeTree
/var/lib/clickhouse/data/airline/ontime
2017-07-01 AA
2017-07-01 EV
2017-07-01 UA
2017-07-02 AA
...
primary.idx
|
|
|
|
.mrk .bin
20170701_20170731_355_355_2/
(FlightDate, Carrier...) ActualElapsedTime Airline AirlineID...
|
|
|
|
.mrk .bin
|
|
|
|
.mrk .bin
Granule
Compressed
Block
Mark
50
© 2021 Altinity, Inc.
CREATE TABLE ontime
(
`Year` UInt16,
`Quarter` UInt8, . . .
)
ENGINE = MergeTree
PARTITION BY Year
PRIMARY KEY (Carrier, FlightDate)
ORDER BY (Carrier, FlightDate, DepTime)
Ensure table design is optimal for queries
51
Results in ~125 parts for
this dataset, avg 107MB
per part
Use columns you filter on
Order columns by increasing cardinality* left to right
*Cardinality = How many unique values in column
© 2021 Altinity, Inc.
Finding out column compression level
SELECT
formatReadableSize(sum(data_compressed_bytes)) AS tc,
formatReadableSize(sum(data_uncompressed_bytes)) AS tu,
sum(data_compressed_bytes) / sum(data_uncompressed_bytes) AS ratio
FROM system.columns
WHERE database = currentDatabase()
AND (table = 'ontime')
AND (name = 'TailNum')
┌─tc────────┬─tu────────┬──────────────ratio─┐
│ 19.33 MiB │ 37.80 MiB │ 0.5112778354359176 │
└───────────┴───────────┴────────────────────┘
52
© 2021 Altinity, Inc.
Make a column smaller with compression
┌─TailNum─┐
│ N3HYAA │
│ N377AA │
│ N377AA │
│ N922AA │
│ N862AA │
│ N3EEAA │
│ N536AA │
│ N665AA │
│ N862AA │
│ N936AA │
│ N4YBAA │
└─────────┘
53
Compression reduces a
string of bits to a different
and hopefully smaller
string of bits
LZ4 Compression
Fast to compress and
decompress. Default for
ClickHouse
ZSTD Compression
Slower to compress but
generally smaller than LZ4.
You have to ask for it
© 2021 Altinity, Inc.
Codecs reduce data before compression
N862AA
Value
LowCardinality
encoding
ZSTD(1)
compression
351
Smaller Value
Something
very small!
Turns each
string into an
integer
Aka Dictionary
Encoding
6 bytes 2 bytes
54
© 2021 Altinity, Inc.
Overview of encodings
Name Best for
LowCardinality Strings with fewer than 10K values
Delta Time series
Double Delta Increasing counters
Gorilla Gauge data (bounces around mean)
T64 Integers other than random hashes
Codec compression may vary between LZ4 and ZSTD
55
© 2021 Altinity, Inc.
How to add codecs and change compression
ALTER TABLE ontime
MODIFY COLUMN TailNum LowCardinality(String)
CODEC(ZSTD(1))
ALTER TABLE ontime
MODIFY COLUMN Year CODEC(DoubleDelta, ZSTD(1))
-- Force ClickHouse to change data
ALTER TABLE ontime UPDATE TailNum = TailNum, Year = Year
WHERE 1
56
© 2021 Altinity, Inc.
Effect of codec and compression changes
57
© 2021 Altinity, Inc.
© 2021 Altinity, Inc.
Getting started
on applications
58
© 2021 Altinity, Inc.
Where is the software? (All open source!)
59
Event streaming
● Apache Kafka
● Apache Pulsar
● Vectorized Redpanda
ELT
● Apache Airflow
● Rudderstack
Rendering/Display
● Apache Superset
● Cube.js
● Grafana
Client Libraries
● C++ - ClickHouse CPP
● Golang - ClickHouse Go
● Java - ClickHouse JDBC
● Javascript/Node.js - Apla
● ODBC - ODBC Driver for ClickHouse
● Python - ClickHouse Driver, ClickHouse
SQLAlchemy
More client library links HERE
Kubernetes
● Altinity Operator for ClickHouse
© 2021 Altinity, Inc.
Where is the documentation?
ClickHouse official docs – https://clickhouse.com/docs/
Altinity Blog – https://altinity.com/blog/
Altinity Youtube Channel –
https://www.youtube.com/channel/UCE3Y2lDKl_ZfjaCrh62onYA
Altinity Knowledge Base – https://kb.altinity.com/
Meetups, other blogs, and external resources. Use your powers of Search!
60
© 2021 Altinity, Inc.
Where can I get help?
Telegram - ClickHouse Channel
Slack
● ClickHouse Public Workspace - clickhousedb.slack.com
● Altinity Public Workspace - altinitydbworkspace.slack.com
Education - Altinity ClickHouse Training
Support - Altinity offers support for ClickHouse in all environments
61
© 2021 Altinity, Inc.
Thank you and
good luck!
https://altinity.com
62

Más contenido relacionado

La actualidad más candente

La actualidad más candente (20)

ClickHouse Materialized Views: The Magic Continues
ClickHouse Materialized Views: The Magic ContinuesClickHouse Materialized Views: The Magic Continues
ClickHouse Materialized Views: The Magic Continues
 
Webinar slides: MORE secrets of ClickHouse Query Performance. By Robert Hodge...
Webinar slides: MORE secrets of ClickHouse Query Performance. By Robert Hodge...Webinar slides: MORE secrets of ClickHouse Query Performance. By Robert Hodge...
Webinar slides: MORE secrets of ClickHouse Query Performance. By Robert Hodge...
 
ClickHouse Query Performance Tips and Tricks, by Robert Hodges, Altinity CEO
ClickHouse Query Performance Tips and Tricks, by Robert Hodges, Altinity CEOClickHouse Query Performance Tips and Tricks, by Robert Hodges, Altinity CEO
ClickHouse Query Performance Tips and Tricks, by Robert Hodges, Altinity CEO
 
High Performance, High Reliability Data Loading on ClickHouse
High Performance, High Reliability Data Loading on ClickHouseHigh Performance, High Reliability Data Loading on ClickHouse
High Performance, High Reliability Data Loading on ClickHouse
 
Introduction to the Mysteries of ClickHouse Replication, By Robert Hodges and...
Introduction to the Mysteries of ClickHouse Replication, By Robert Hodges and...Introduction to the Mysteries of ClickHouse Replication, By Robert Hodges and...
Introduction to the Mysteries of ClickHouse Replication, By Robert Hodges and...
 
Data Warehouses in Kubernetes Visualized: the ClickHouse Kubernetes Operator UI
Data Warehouses in Kubernetes Visualized: the ClickHouse Kubernetes Operator UIData Warehouses in Kubernetes Visualized: the ClickHouse Kubernetes Operator UI
Data Warehouses in Kubernetes Visualized: the ClickHouse Kubernetes Operator UI
 
All About JSON and ClickHouse - Tips, Tricks and New Features-2022-07-26-FINA...
All About JSON and ClickHouse - Tips, Tricks and New Features-2022-07-26-FINA...All About JSON and ClickHouse - Tips, Tricks and New Features-2022-07-26-FINA...
All About JSON and ClickHouse - Tips, Tricks and New Features-2022-07-26-FINA...
 
A Practical Introduction to Handling Log Data in ClickHouse, by Robert Hodges...
A Practical Introduction to Handling Log Data in ClickHouse, by Robert Hodges...A Practical Introduction to Handling Log Data in ClickHouse, by Robert Hodges...
A Practical Introduction to Handling Log Data in ClickHouse, by Robert Hodges...
 
Tricks every ClickHouse designer should know, by Robert Hodges, Altinity CEO
Tricks every ClickHouse designer should know, by Robert Hodges, Altinity CEOTricks every ClickHouse designer should know, by Robert Hodges, Altinity CEO
Tricks every ClickHouse designer should know, by Robert Hodges, Altinity CEO
 
ClickHouse Data Warehouse 101: The First Billion Rows, by Alexander Zaitsev a...
ClickHouse Data Warehouse 101: The First Billion Rows, by Alexander Zaitsev a...ClickHouse Data Warehouse 101: The First Billion Rows, by Alexander Zaitsev a...
ClickHouse Data Warehouse 101: The First Billion Rows, by Alexander Zaitsev a...
 
Fun with click house window functions webinar slides 2021-08-19
Fun with click house window functions webinar slides  2021-08-19Fun with click house window functions webinar slides  2021-08-19
Fun with click house window functions webinar slides 2021-08-19
 
ClickHouse Monitoring 101: What to monitor and how
ClickHouse Monitoring 101: What to monitor and howClickHouse Monitoring 101: What to monitor and how
ClickHouse Monitoring 101: What to monitor and how
 
Building ClickHouse and Making Your First Contribution: A Tutorial_06.10.2021
Building ClickHouse and Making Your First Contribution: A Tutorial_06.10.2021Building ClickHouse and Making Your First Contribution: A Tutorial_06.10.2021
Building ClickHouse and Making Your First Contribution: A Tutorial_06.10.2021
 
Using ClickHouse for Experimentation
Using ClickHouse for ExperimentationUsing ClickHouse for Experimentation
Using ClickHouse for Experimentation
 
Adventures with the ClickHouse ReplacingMergeTree Engine
Adventures with the ClickHouse ReplacingMergeTree EngineAdventures with the ClickHouse ReplacingMergeTree Engine
Adventures with the ClickHouse ReplacingMergeTree Engine
 
A day in the life of a click house query
A day in the life of a click house queryA day in the life of a click house query
A day in the life of a click house query
 
Webinar: Secrets of ClickHouse Query Performance, by Robert Hodges
Webinar: Secrets of ClickHouse Query Performance, by Robert HodgesWebinar: Secrets of ClickHouse Query Performance, by Robert Hodges
Webinar: Secrets of ClickHouse Query Performance, by Robert Hodges
 
ClickHouse Keeper
ClickHouse KeeperClickHouse Keeper
ClickHouse Keeper
 
ClickHouse Mark Cache, by Mik Kocikowski, Cloudflare
ClickHouse Mark Cache, by Mik Kocikowski, CloudflareClickHouse Mark Cache, by Mik Kocikowski, Cloudflare
ClickHouse Mark Cache, by Mik Kocikowski, Cloudflare
 
Redpanda and ClickHouse
Redpanda and ClickHouseRedpanda and ClickHouse
Redpanda and ClickHouse
 

Similar a Altinity Quickstart for ClickHouse

Creating Virtual Infrastructure
Creating Virtual InfrastructureCreating Virtual Infrastructure
Creating Virtual Infrastructure
Jake Weston
 

Similar a Altinity Quickstart for ClickHouse (20)

Altinity Quickstart for ClickHouse-2202-09-15.pdf
Altinity Quickstart for ClickHouse-2202-09-15.pdfAltinity Quickstart for ClickHouse-2202-09-15.pdf
Altinity Quickstart for ClickHouse-2202-09-15.pdf
 
Altinity Webinar: Introduction to Altinity.Cloud-Platform for Real-Time Data.pdf
Altinity Webinar: Introduction to Altinity.Cloud-Platform for Real-Time Data.pdfAltinity Webinar: Introduction to Altinity.Cloud-Platform for Real-Time Data.pdf
Altinity Webinar: Introduction to Altinity.Cloud-Platform for Real-Time Data.pdf
 
Building High Performance Apps with Altinity Stable Builds for ClickHouse | A...
Building High Performance Apps with Altinity Stable Builds for ClickHouse | A...Building High Performance Apps with Altinity Stable Builds for ClickHouse | A...
Building High Performance Apps with Altinity Stable Builds for ClickHouse | A...
 
Own your ClickHouse data with Altinity.Cloud Anywhere-2023-01-17.pdf
Own your ClickHouse data with Altinity.Cloud Anywhere-2023-01-17.pdfOwn your ClickHouse data with Altinity.Cloud Anywhere-2023-01-17.pdf
Own your ClickHouse data with Altinity.Cloud Anywhere-2023-01-17.pdf
 
Taming the Tiger: Tips and Tricks for Using Telegraf
Taming the Tiger: Tips and Tricks for Using TelegrafTaming the Tiger: Tips and Tricks for Using Telegraf
Taming the Tiger: Tips and Tricks for Using Telegraf
 
Cloud-native .NET-Microservices mit Kubernetes @BASTAcon
Cloud-native .NET-Microservices mit Kubernetes @BASTAconCloud-native .NET-Microservices mit Kubernetes @BASTAcon
Cloud-native .NET-Microservices mit Kubernetes @BASTAcon
 
Creating Beautiful Dashboards with Grafana and ClickHouse
Creating Beautiful Dashboards with Grafana and ClickHouseCreating Beautiful Dashboards with Grafana and ClickHouse
Creating Beautiful Dashboards with Grafana and ClickHouse
 
002 Introducing Neo4j 5 for Administrators - NODES2022 AMERICAS Beginner 2 - ...
002 Introducing Neo4j 5 for Administrators - NODES2022 AMERICAS Beginner 2 - ...002 Introducing Neo4j 5 for Administrators - NODES2022 AMERICAS Beginner 2 - ...
002 Introducing Neo4j 5 for Administrators - NODES2022 AMERICAS Beginner 2 - ...
 
Enterprise serverless
Enterprise serverlessEnterprise serverless
Enterprise serverless
 
AWS Summit DC 2021: Improve the developer experience with AWS CDK
AWS Summit DC 2021: Improve the developer experience with AWS CDKAWS Summit DC 2021: Improve the developer experience with AWS CDK
AWS Summit DC 2021: Improve the developer experience with AWS CDK
 
Deploying Magento on OCI with MDS
Deploying Magento on OCI with MDSDeploying Magento on OCI with MDS
Deploying Magento on OCI with MDS
 
Meetup OpenTelemetry Intro
Meetup OpenTelemetry IntroMeetup OpenTelemetry Intro
Meetup OpenTelemetry Intro
 
Streaming Architecture Walkthrough.pdf
Streaming Architecture Walkthrough.pdfStreaming Architecture Walkthrough.pdf
Streaming Architecture Walkthrough.pdf
 
Creating Virtual Infrastructure
Creating Virtual InfrastructureCreating Virtual Infrastructure
Creating Virtual Infrastructure
 
Mule soft meetup_virtual_ charlotte_2020_final1
Mule soft meetup_virtual_ charlotte_2020_final1Mule soft meetup_virtual_ charlotte_2020_final1
Mule soft meetup_virtual_ charlotte_2020_final1
 
ClickHouse tips and tricks. Webinar slides. By Robert Hodges, Altinity CEO
ClickHouse tips and tricks. Webinar slides. By Robert Hodges, Altinity CEOClickHouse tips and tricks. Webinar slides. By Robert Hodges, Altinity CEO
ClickHouse tips and tricks. Webinar slides. By Robert Hodges, Altinity CEO
 
Dart on Arm - Flutter Bangalore June 2021
Dart on Arm - Flutter Bangalore June 2021Dart on Arm - Flutter Bangalore June 2021
Dart on Arm - Flutter Bangalore June 2021
 
Cloud Native Data Warehouses - Intro to ClickHouse on Kubernetes-2021-07.pdf
Cloud Native Data Warehouses - Intro to ClickHouse on Kubernetes-2021-07.pdfCloud Native Data Warehouses - Intro to ClickHouse on Kubernetes-2021-07.pdf
Cloud Native Data Warehouses - Intro to ClickHouse on Kubernetes-2021-07.pdf
 
State of Steeltoe 2020
State of Steeltoe 2020State of Steeltoe 2020
State of Steeltoe 2020
 
Real World Modern Development Use Cases with RackHD and Adobe
Real World Modern Development Use Cases with RackHD and AdobeReal World Modern Development Use Cases with RackHD and Adobe
Real World Modern Development Use Cases with RackHD and Adobe
 

Más de Altinity Ltd

Más de Altinity Ltd (20)

Building an Analytic Extension to MySQL with ClickHouse and Open Source.pptx
Building an Analytic Extension to MySQL with ClickHouse and Open Source.pptxBuilding an Analytic Extension to MySQL with ClickHouse and Open Source.pptx
Building an Analytic Extension to MySQL with ClickHouse and Open Source.pptx
 
Cloud Native ClickHouse at Scale--Using the Altinity Kubernetes Operator-2022...
Cloud Native ClickHouse at Scale--Using the Altinity Kubernetes Operator-2022...Cloud Native ClickHouse at Scale--Using the Altinity Kubernetes Operator-2022...
Cloud Native ClickHouse at Scale--Using the Altinity Kubernetes Operator-2022...
 
Building an Analytic Extension to MySQL with ClickHouse and Open Source
Building an Analytic Extension to MySQL with ClickHouse and Open SourceBuilding an Analytic Extension to MySQL with ClickHouse and Open Source
Building an Analytic Extension to MySQL with ClickHouse and Open Source
 
Fun with ClickHouse Window Functions-2021-08-19.pdf
Fun with ClickHouse Window Functions-2021-08-19.pdfFun with ClickHouse Window Functions-2021-08-19.pdf
Fun with ClickHouse Window Functions-2021-08-19.pdf
 
Application Monitoring using Open Source - VictoriaMetrics & Altinity ClickHo...
Application Monitoring using Open Source - VictoriaMetrics & Altinity ClickHo...Application Monitoring using Open Source - VictoriaMetrics & Altinity ClickHo...
Application Monitoring using Open Source - VictoriaMetrics & Altinity ClickHo...
 
ClickHouse ReplacingMergeTree in Telecom Apps
ClickHouse ReplacingMergeTree in Telecom AppsClickHouse ReplacingMergeTree in Telecom Apps
ClickHouse ReplacingMergeTree in Telecom Apps
 
Building a Real-Time Analytics Application with Apache Pulsar and Apache Pinot
Building a Real-Time Analytics Application with  Apache Pulsar and Apache PinotBuilding a Real-Time Analytics Application with  Apache Pulsar and Apache Pinot
Building a Real-Time Analytics Application with Apache Pulsar and Apache Pinot
 
OSA Con 2022 - What Data Engineering Can Learn from Frontend Engineering - Pe...
OSA Con 2022 - What Data Engineering Can Learn from Frontend Engineering - Pe...OSA Con 2022 - What Data Engineering Can Learn from Frontend Engineering - Pe...
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 - Welcome to OSA CON Version 2022 - Robert Hodges - Altinity.pdfOSA Con 2022 - Welcome to OSA CON Version 2022 - Robert Hodges - Altinity.pdf
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 - Using ClickHouse Database to Power Analytics and Customer Enga...OSA Con 2022 - Using ClickHouse Database to Power Analytics and Customer Enga...
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 - Tips and Tricks to Keep Your Queries under 100ms with ClickHou...OSA Con 2022 - Tips and Tricks to Keep Your Queries under 100ms with ClickHou...
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 - The Open Source Analytic Universe, Version 2022 - Robert Hodge...OSA Con 2022 - The Open Source Analytic Universe, Version 2022 - Robert Hodge...
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 - Switching Jaeger Distributed Tracing to ClickHouse to Enable A...OSA Con 2022 - Switching Jaeger Distributed Tracing to ClickHouse to Enable A...
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 - Streaming Data Made Easy - Tim Spann & David Kjerrumgaard - St...OSA Con 2022 - Streaming Data Made Easy - Tim Spann & David Kjerrumgaard - St...
OSA Con 2022 - Streaming Data Made Easy - Tim Spann & David Kjerrumgaard - St...
 
OSA Con 2022 - State of Open Source Databases - Peter Zaitsev - Percona.pdf
OSA Con 2022 - State of Open Source Databases - Peter Zaitsev - Percona.pdfOSA Con 2022 - State of Open Source Databases - Peter Zaitsev - Percona.pdf
OSA Con 2022 - State of Open Source Databases - Peter Zaitsev - Percona.pdf
 
OSA Con 2022 - Specifics of data analysis in Time Series Databases - Roman Kh...
OSA Con 2022 - Specifics of data analysis in Time Series Databases - Roman Kh...OSA Con 2022 - Specifics of data analysis in Time Series Databases - Roman Kh...
OSA Con 2022 - Specifics of data analysis in Time Series Databases - Roman Kh...
 
OSA Con 2022 - Signal Correlation, the Ho11y Grail - Michael Hausenblas - AWS...
OSA Con 2022 - Signal Correlation, the Ho11y Grail - Michael Hausenblas - AWS...OSA Con 2022 - Signal Correlation, the Ho11y Grail - Michael Hausenblas - AWS...
OSA Con 2022 - Signal Correlation, the Ho11y Grail - Michael Hausenblas - AWS...
 
OSA Con 2022 - Scaling your Pandas Analytics with Modin - Doris Lee - Ponder.pdf
OSA Con 2022 - Scaling your Pandas Analytics with Modin - Doris Lee - Ponder.pdfOSA Con 2022 - Scaling your Pandas Analytics with Modin - Doris Lee - Ponder.pdf
OSA Con 2022 - Scaling your Pandas Analytics with Modin - Doris Lee - Ponder.pdf
 
OSA Con 2022 - Quick Reflexes_ Building Real-Time Data Analytics with Redpand...
OSA Con 2022 - Quick Reflexes_ Building Real-Time Data Analytics with Redpand...OSA Con 2022 - Quick Reflexes_ Building Real-Time Data Analytics with Redpand...
OSA Con 2022 - Quick Reflexes_ Building Real-Time Data Analytics with Redpand...
 
OSA Con 2022 - Extract, Transform, and Learn about your developers - Brian Le...
OSA Con 2022 - Extract, Transform, and Learn about your developers - Brian Le...OSA Con 2022 - Extract, Transform, and Learn about your developers - Brian Le...
OSA Con 2022 - Extract, Transform, and Learn about your developers - Brian Le...
 

Último

Cytotec in Jeddah+966572737505) get unwanted pregnancy kit Riyadh
Cytotec in Jeddah+966572737505) get unwanted pregnancy kit RiyadhCytotec in Jeddah+966572737505) get unwanted pregnancy kit Riyadh
Cytotec in Jeddah+966572737505) get unwanted pregnancy kit Riyadh
Abortion pills in Riyadh +966572737505 get cytotec
 
Top profile Call Girls In Satna [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In Satna [ 7014168258 ] Call Me For Genuine Models We ...Top profile Call Girls In Satna [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In Satna [ 7014168258 ] Call Me For Genuine Models We ...
nirzagarg
 
一比一原版(UCD毕业证书)加州大学戴维斯分校毕业证成绩单原件一模一样
一比一原版(UCD毕业证书)加州大学戴维斯分校毕业证成绩单原件一模一样一比一原版(UCD毕业证书)加州大学戴维斯分校毕业证成绩单原件一模一样
一比一原版(UCD毕业证书)加州大学戴维斯分校毕业证成绩单原件一模一样
wsppdmt
 
Abortion pills in Doha Qatar (+966572737505 ! Get Cytotec
Abortion pills in Doha Qatar (+966572737505 ! Get CytotecAbortion pills in Doha Qatar (+966572737505 ! Get Cytotec
Abortion pills in Doha Qatar (+966572737505 ! Get Cytotec
Abortion pills in Riyadh +966572737505 get cytotec
 
Lecture_2_Deep_Learning_Overview-newone1
Lecture_2_Deep_Learning_Overview-newone1Lecture_2_Deep_Learning_Overview-newone1
Lecture_2_Deep_Learning_Overview-newone1
ranjankumarbehera14
 
Jual obat aborsi Bandung ( 085657271886 ) Cytote pil telat bulan penggugur ka...
Jual obat aborsi Bandung ( 085657271886 ) Cytote pil telat bulan penggugur ka...Jual obat aborsi Bandung ( 085657271886 ) Cytote pil telat bulan penggugur ka...
Jual obat aborsi Bandung ( 085657271886 ) Cytote pil telat bulan penggugur ka...
Klinik kandungan
 
Gartner's Data Analytics Maturity Model.pptx
Gartner's Data Analytics Maturity Model.pptxGartner's Data Analytics Maturity Model.pptx
Gartner's Data Analytics Maturity Model.pptx
chadhar227
 
Reconciling Conflicting Data Curation Actions: Transparency Through Argument...
Reconciling Conflicting Data Curation Actions:  Transparency Through Argument...Reconciling Conflicting Data Curation Actions:  Transparency Through Argument...
Reconciling Conflicting Data Curation Actions: Transparency Through Argument...
Bertram Ludäscher
 
Top profile Call Girls In Vadodara [ 7014168258 ] Call Me For Genuine Models ...
Top profile Call Girls In Vadodara [ 7014168258 ] Call Me For Genuine Models ...Top profile Call Girls In Vadodara [ 7014168258 ] Call Me For Genuine Models ...
Top profile Call Girls In Vadodara [ 7014168258 ] Call Me For Genuine Models ...
gajnagarg
 
+97470301568>>weed for sale in qatar ,weed for sale in dubai,weed for sale in...
+97470301568>>weed for sale in qatar ,weed for sale in dubai,weed for sale in...+97470301568>>weed for sale in qatar ,weed for sale in dubai,weed for sale in...
+97470301568>>weed for sale in qatar ,weed for sale in dubai,weed for sale in...
Health
 
PLE-statistics document for primary schs
PLE-statistics document for primary schsPLE-statistics document for primary schs
PLE-statistics document for primary schs
cnajjemba
 

Último (20)

The-boAt-Story-Navigating-the-Waves-of-Innovation.pptx
The-boAt-Story-Navigating-the-Waves-of-Innovation.pptxThe-boAt-Story-Navigating-the-Waves-of-Innovation.pptx
The-boAt-Story-Navigating-the-Waves-of-Innovation.pptx
 
Vadodara 💋 Call Girl 7737669865 Call Girls in Vadodara Escort service book now
Vadodara 💋 Call Girl 7737669865 Call Girls in Vadodara Escort service book nowVadodara 💋 Call Girl 7737669865 Call Girls in Vadodara Escort service book now
Vadodara 💋 Call Girl 7737669865 Call Girls in Vadodara Escort service book now
 
Cytotec in Jeddah+966572737505) get unwanted pregnancy kit Riyadh
Cytotec in Jeddah+966572737505) get unwanted pregnancy kit RiyadhCytotec in Jeddah+966572737505) get unwanted pregnancy kit Riyadh
Cytotec in Jeddah+966572737505) get unwanted pregnancy kit Riyadh
 
Top profile Call Girls In Satna [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In Satna [ 7014168258 ] Call Me For Genuine Models We ...Top profile Call Girls In Satna [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In Satna [ 7014168258 ] Call Me For Genuine Models We ...
 
一比一原版(UCD毕业证书)加州大学戴维斯分校毕业证成绩单原件一模一样
一比一原版(UCD毕业证书)加州大学戴维斯分校毕业证成绩单原件一模一样一比一原版(UCD毕业证书)加州大学戴维斯分校毕业证成绩单原件一模一样
一比一原版(UCD毕业证书)加州大学戴维斯分校毕业证成绩单原件一模一样
 
Abortion pills in Doha Qatar (+966572737505 ! Get Cytotec
Abortion pills in Doha Qatar (+966572737505 ! Get CytotecAbortion pills in Doha Qatar (+966572737505 ! Get Cytotec
Abortion pills in Doha Qatar (+966572737505 ! Get Cytotec
 
Lecture_2_Deep_Learning_Overview-newone1
Lecture_2_Deep_Learning_Overview-newone1Lecture_2_Deep_Learning_Overview-newone1
Lecture_2_Deep_Learning_Overview-newone1
 
Jual obat aborsi Bandung ( 085657271886 ) Cytote pil telat bulan penggugur ka...
Jual obat aborsi Bandung ( 085657271886 ) Cytote pil telat bulan penggugur ka...Jual obat aborsi Bandung ( 085657271886 ) Cytote pil telat bulan penggugur ka...
Jual obat aborsi Bandung ( 085657271886 ) Cytote pil telat bulan penggugur ka...
 
Gartner's Data Analytics Maturity Model.pptx
Gartner's Data Analytics Maturity Model.pptxGartner's Data Analytics Maturity Model.pptx
Gartner's Data Analytics Maturity Model.pptx
 
Predicting HDB Resale Prices - Conducting Linear Regression Analysis With Orange
Predicting HDB Resale Prices - Conducting Linear Regression Analysis With OrangePredicting HDB Resale Prices - Conducting Linear Regression Analysis With Orange
Predicting HDB Resale Prices - Conducting Linear Regression Analysis With Orange
 
Capstone in Interprofessional Informatic // IMPACT OF COVID 19 ON EDUCATION
Capstone in Interprofessional Informatic  // IMPACT OF COVID 19 ON EDUCATIONCapstone in Interprofessional Informatic  // IMPACT OF COVID 19 ON EDUCATION
Capstone in Interprofessional Informatic // IMPACT OF COVID 19 ON EDUCATION
 
DATA SUMMIT 24 Building Real-Time Pipelines With FLaNK
DATA SUMMIT 24  Building Real-Time Pipelines With FLaNKDATA SUMMIT 24  Building Real-Time Pipelines With FLaNK
DATA SUMMIT 24 Building Real-Time Pipelines With FLaNK
 
Reconciling Conflicting Data Curation Actions: Transparency Through Argument...
Reconciling Conflicting Data Curation Actions:  Transparency Through Argument...Reconciling Conflicting Data Curation Actions:  Transparency Through Argument...
Reconciling Conflicting Data Curation Actions: Transparency Through Argument...
 
Sequential and reinforcement learning for demand side management by Margaux B...
Sequential and reinforcement learning for demand side management by Margaux B...Sequential and reinforcement learning for demand side management by Margaux B...
Sequential and reinforcement learning for demand side management by Margaux B...
 
Harnessing the Power of GenAI for BI and Reporting.pptx
Harnessing the Power of GenAI for BI and Reporting.pptxHarnessing the Power of GenAI for BI and Reporting.pptx
Harnessing the Power of GenAI for BI and Reporting.pptx
 
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
 
Top profile Call Girls In Vadodara [ 7014168258 ] Call Me For Genuine Models ...
Top profile Call Girls In Vadodara [ 7014168258 ] Call Me For Genuine Models ...Top profile Call Girls In Vadodara [ 7014168258 ] Call Me For Genuine Models ...
Top profile Call Girls In Vadodara [ 7014168258 ] Call Me For Genuine Models ...
 
+97470301568>>weed for sale in qatar ,weed for sale in dubai,weed for sale in...
+97470301568>>weed for sale in qatar ,weed for sale in dubai,weed for sale in...+97470301568>>weed for sale in qatar ,weed for sale in dubai,weed for sale in...
+97470301568>>weed for sale in qatar ,weed for sale in dubai,weed for sale in...
 
Ranking and Scoring Exercises for Research
Ranking and Scoring Exercises for ResearchRanking and Scoring Exercises for Research
Ranking and Scoring Exercises for Research
 
PLE-statistics document for primary schs
PLE-statistics document for primary schsPLE-statistics document for primary schs
PLE-statistics document for primary schs
 

Altinity Quickstart for ClickHouse

  • 1. © 2021 Altinity, Inc. Altinity Quickstart for ClickHouse Creating your first application 1 Version 2022-01
  • 2. © 2021 Altinity, Inc. Let’s make some introductions ClickHouse support and services including Altinity.Cloud Authors of Altinity Kubernetes Operator for ClickHouse and other open source projects Us Database geeks with centuries of experience in DBMS and applications You Applications developers looking to learn about ClickHouse 2
  • 3. © 2021 Altinity, Inc. © 2021 Altinity, Inc. What’s a ClickHouse? 3
  • 4. © 2021 Altinity, Inc. Understands SQL Runs on bare metal to cloud Shared nothing architecture Stores data in columns Parallel and vectorized execution Scales to many petabytes Is Open source (Apache 2.0) ClickHouse is a SQL Data Warehouse It’s the core engine for real-time analytics ClickHouse Event Streams ELT Object Storage Interactive Graphics Dashboards APIs 4
  • 5. © 2021 Altinity, Inc. What ClickHouse Is Not… ClickHouse does not have full ACID transactions and updates are slow ClickHouse is designed to read large blocks of data for a few users ClickHouse values speed over SQL standards and runs anywhere 5
  • 6. © 2021 Altinity, Inc. ClickHouse stores data in columns, not rows Carrier FlightDate TailNum ... Cancelled Delayed Carrier FlightDate TailNum ... Cancelled Delayed Carrier FlightDate TailNum ... Cancelled Delayed Carrier FlightDate TailNum ... Cancelled Delayed Carrier FlightDate TailNum ... Cancelled Delayed Dimensions… Measurements… Sort Ordering 6
  • 7. © 2021 Altinity, Inc. It compresses data and has great parallel query 59 GB (100%) 21 MB (.035%) 2.6 MB (.0044%) 1.7 GB (3%) Read all columns Read 3 columns Read 3 compressed columns Read 3 compressed columns over 8 threads 7
  • 8. © 2021 Altinity, Inc. © 2021 Altinity, Inc. Installing ClickHouse and Connecting 8
  • 9. © 2021 Altinity, Inc. Install ClickHouse from a build repo # Ubuntu example sudo apt-get install -y clickhouse-server clickhouse-client sudo systemctl start clickhouse-server Altinity Stable Builds Prod-ready LTS builds only (3 years of support) https://docs.altinity.com ClickHouse Community Builds Monthly builds LTS builds every 6 months (1 year of support) https://clickhouse.com 9
  • 10. © 2021 Altinity, Inc. Install ClickHouse using Docker mkdir $HOME/clickhouse-data docker run -d --name clickhouse-server --ulimit nofile=262144:262144 --volume=$HOME/clickhouse-data:/var/lib/clickhouse -p 8123:8123 -p 9000:9000 yandex/clickhouse-server 10 Persist data Make ports visible Make ClickHouse happy Altinity Stable Builds Tag: altinity/clickhouse-server ClickHouse Community Builds Tag: yandex/clickhouse-server
  • 11. © 2021 Altinity, Inc. (Trials available) ● Altinity.Cloud -- Runs in AWS and GCP ● Yandex Managed Service for ClickHouse -- Runs in Yandex.Cloud Install ClickHouse in the cloud 11
  • 12. © 2021 Altinity, Inc. Connecting from the command line -- Connect to ClickHouse running locally on your laptop. clickhouse-client -- Same thing with explicit options. clickhouse-client --host=localhost --port=9000 --user=default -- Connect to a secure ClickHouse running in the Cloud. clickhouse-client --host=github.demo.altinity.cloud --port=9440 --secure --user=demo --password=demo 12
  • 13. © 2021 Altinity, Inc. Connecting to built-in web UI URL Format: http[s]://host:port/play Example: https://github.demo.altinity.cloud:8443/play (user=demo/pw=demo) Example: http://localhost:8123/play (user=default/pw=null) User Password 13
  • 14. © 2021 Altinity, Inc. © 2021 Altinity, Inc. Finding your way around ClickHouse 14
  • 15. © 2021 Altinity, Inc. Databases and tables ● Every ClickHouse has databases and tables ● ClickHouse databases are like folders: ○ MySQL databases ○ PostgreSQL schemas ● Every connection has a “current” database ○ Tables in the current database don’t need a database name 15
  • 16. © 2021 Altinity, Inc. Handy commands for navigation 16 SQL Command What it does show databases List databases in ClickHouse select currentDatabase() What’s my current database? show tables [from name] Show tables [in a particular database] describe table name Show the structure of table SELECT count() FROM ontime Select from table ontime in current database SELECT count() FROM anotherdb.ontime Select from table ontime in database anotherdb
  • 17. © 2021 Altinity, Inc. Selecting the database ● clickhouse-client allows you to switch between databases in a session clickhouse101 :) use system Ok. ● Most APIs require you to set the database in the URL. ○ HTTP: https://rhodges_59945:<pw>@clickhouse101.demo.altinity.cloud:8443?database=system ○ JDBC: jdbc:clickhouse://clickhouse101.demo.altinity.cloud:8443/rhodges_59945 ○ Python SQLAlchemy: clickhouse+native://demo:demo@github.demo.altinity.cloud/default?secure=true 17
  • 18. © 2021 Altinity, Inc. Special databases in ClickHouse default -- Standard database for user data in a new ClickHouse installation config.xml: <default_database>default</default_database> system -- Database for system tables SHOW TABLES FROM system ┌─name───────────────────────────┐ │ aggregate_function_combinators │ │ asynchronous_metric_log │ │ asynchronous_metrics │ │ build_options │ │ clusters │ │ collations │ │ columns │ 18 Your friends :)
  • 19. © 2021 Altinity, Inc. © 2021 Altinity, Inc. Creating Your First Table and Loading Data 19
  • 20. © 2021 Altinity, Inc. Let’s create a table! CREATE TABLE IF NOT EXISTS sdata ( DevId Int32, Type String, MDate Date, MDatetime DateTime, Value Float64 ) ENGINE = MergeTree() PARTITION BY toYYYYMM(MDate) ORDER BY (DevId, MDatetime) 20 Table engine type How to break data into parts How to index and sort data in each part Table columns
  • 21. © 2021 Altinity, Inc. Let’s insert some data the hard way… INSERT INTO sdata VALUES (15, 'TEMP', '2018-01-01', '2018-01-01 23:29:55', 18.0), (15, 'TEMP', '2018-01-01', '2018-01-01 23:30:56', 18.7) 21 OK, nobody really does this.
  • 22. © 2021 Altinity, Inc. Use input formats to load raw data Format Description Values Normal INSERT tuples like (‘a’, 1, 35.7) CSV, CSVWithNames Comma-separated values, CSV with column names JSONEachRow Single JSON record per row (many JSON formats supported) Protobuf Google Protocol Buffers format Avro, AvroConfluent Apache Avro and Confluent/Kafka variant Parquet Apache Parquet columnar data format ORC Apache ORC (another columnar format from Hadoop) * Try this: select * from system.formats * Or this: https://clickhouse.com/docs/en/interfaces/formats/ 22
  • 23. © 2021 Altinity, Inc. DevId,Type,MDate,MDatetime,Value 59,"TEMP","2018-02-01","2018-02-01 01:10:13",19.5 59,"TEMP","2018-02-01","2018-02-01 02:10:01",18.8 59,"TEMP","2018-02-01","2018-02-01 03:09:58",18.6 59,"TEMP","2018-02-01","2018-02-01 04:10:05",15.1 59,"TEMP","2018-02-01","2018-02-01 05:10:31",12.2 23 cat sdata.csv | clickhouse-client --database=sense --query='INSERT INTO sdata FORMAT CSVWithNames' Input file sdata.csv Use clickhouse-client to load raw data from command line
  • 24. © 2021 Altinity, Inc. Or with HTTP commands 24 #!/bin/bash insert='INSERT%20INTO%20sense.sdata%20Format%20CSVWithNames' curl -v "http://localhost:8123/?query=${insert}" --data-binary @sdata.csv Uses HTTP POST Read data from file
  • 25. © 2021 Altinity, Inc. Or you could insert from S3 SET max_insert_threads=32 INSERT INTO sdata SELECT * FROM s3( 'https://s3.us-east-1.amazonaws.com/d1-alt/d1/sdata*.csv.gz', 'aws_access_key_id', 'aws_secret_access_key', 'CSVWithNames', 'DevId Int32, Type String, MDate Date, MDatetime DateTime, Value Float64') Parallelize! Read multiple files Schema (Not needed after 22.1) Input format 25
  • 26. © 2021 Altinity, Inc. How to update and delete rows ALTER TABLE ontime UPDATE UniqueCarrier = 'OO2' WHERE UniqueCarrier = 'OO' ALTER TABLE ontime DELETE WHERE UniqueCarrier = 'OO2' 26 Asynchronous Different syntax from standard SQL Can be expensive!
  • 27. © 2021 Altinity, Inc. How to find out if update/delete has finished SELECT command, is_done FROM system.mutations WHERE table = 'ontime' ┌─command─────────────────────────────────────────────────┬─is_done─┐ │ UPDATE UniqueCarrier = 'OO2' WHERE UniqueCarrier = 'OO' │ 1 │ │ DELETE WHERE UniqueCarrier = 'OO2' │ 1 │ └─────────────────────────────────────────────────────────┴─────────┘ KILL mutation WHERE table = 'ontime' 27 Tracks progress of “mutations” Cancels mutation
  • 28. © 2021 Altinity, Inc. What’s going on down there when you INSERT? Table Part Index Columns Sparse index finds rows by DevId, MDatetime Columns sorted by DevId, MDatetime Rows in the part all belong to same month Part Index Columns Part 28
  • 29. © 2021 Altinity, Inc. Why MergeTree? Because it merges! Part Index Columns Part Index Columns Rewritten, Bigger Part Index Columns 29 Update and delete also rewrite parts
  • 30. © 2021 Altinity, Inc. Top three tips for table design and data loading ● Pick a PARTITION BY that gives nice, fat partitions ( 1-300GB, < 1000 total parts) ○ Can’t decide? Partition by month. ● Use input formats to load raw data directly ● Insert large blocks of data to avoid lots of merges afterwards ○ ClickHouse will default up to 1,048,576 rows in a single part. You can increase it to tens of millions 30
  • 31. © 2021 Altinity, Inc. © 2021 Altinity, Inc. Selecting Data 31
  • 32. © 2021 Altinity, Inc. SELECT allows us to fetch interesting data 32
  • 33. © 2021 Altinity, Inc. Who had the most cancelled flights in 2017? SELECT Carrier, toYear(FlightDate) AS Year, sum(Cancelled)/count(*) * 100. AS cancelled FROM ontime WHERE Year = 2017 GROUP BY Carrier, Year HAVING cancelled > 1.0 ORDER BY cancelled DESC LIMIT 10 Dimensions Aggregate Range Filter Aggregate Filter Order of results Max results 33
  • 34. © 2021 Altinity, Inc. Rule #1 for selecting data in ClickHouse 34 Most SQL SELECT syntax “just works” in ClickHouse So what’s different?
  • 35. © 2021 Altinity, Inc. If you are using ClickHouse, time is probably important Time series == Data with built-in time ordering 35
  • 36. © 2021 Altinity, Inc. Using time dimensions in queries SELECT toStartOfWeek(FlightDate) AS Week, Carrier, count() AS Flights FROM default.ontime_ref WHERE FlightDate BETWEEN toDate('2015-01-01') AND toDate('2015-06-30') GROUP BY Week, Carrier ORDER BY Carrier, Week 36
  • 37. © 2021 Altinity, Inc. ClickHouse has excellent date-time support Date -- Precision to day DateTime -- Precision to second DateTime64 -- Precision to nanosecond toYear(), toMonth(), toWeek(), toDayOfWeek, toDay(), toHour(), ... toStartOfYear(), toStartOfQuarter(), toStartOfMonth(), toStartOfHour(), toStartOfMinute(), …, toStartOfInterval() toYYYYMM() toYYYYMMDD() toYYYYMMDDhhmmsss() And many more! 37 BI tools like Grafana like DateTime values
  • 38. © 2021 Altinity, Inc. ClickHouse has a very rich set of aggregates, too 38 Standard SQL aggregation functions ● count() ● avg() ● sum() ● min() ● max() And many more native to ClickHouse ● any() ● anyLast() ● avgWeighted() ● uniq() ● uniqExact() ● quantile() ● quantileExact() ● simpleLinearRegression() ● groupArray() ● …
  • 39. © 2021 Altinity, Inc. Drilling into GROUP BY syntax SELECT Carrier, toYear(FlightDate) AS Year, count() AS TotalFlights, sum(Cancelled) AS TotalCancelled FROM ontime GROUP BY Carrier, Year Dimensions Every thing else must be an aggregate Dimensions must be in GROUP BY 39
  • 40. © 2021 Altinity, Inc. Another example: find “Top N”with ORDER BY and LIMIT SELECT o.Origin, any(o.OriginCityName) AS OriginCityName, any(o.OriginState) AS OriginState, COUNT() as Flights FROM ontime o GROUP BY Origin ORDER BY Flights DESC LIMIT 10 Correlated values Measure Dimension 40
  • 41. © 2021 Altinity, Inc. JOIN combines data between tables SELECT o.Dest, any(a.Name) AS AirportName, count(Dest) AS Flights FROM ontime o LEFT JOIN airports a ON a.IATA = toString(o.Dest) GROUP BY Dest ORDER BY Flights DESC LIMIT 10 41 Join condition Join type Include ontime data even if we can’t find the airport name
  • 42. © 2021 Altinity, Inc. Let’s look more closely at joins . . . IATA . . . airports . . . Dest . . . ontime LEFT [OUTER] JOIN FULL [OUTER] JOIN RIGHT [OUTER] JOIN All ontime rows, plus matching airport rows All airport rows, plus matching ontime rows [INNER] JOIN Only rows that match on both sides Matching rows, plus non-matching rows from both sides CROSS JOIN Matches all rows with each other. Aka “cartesian join” SELECT . . . FROM ontime o JOIN airports a ON a.IATA = toString(o.Dest) 42 Left Right
  • 43. © 2021 Altinity, Inc. You can check this yourself with sample tables Table Left id value 1 Left 2 Left Table Right id value 2 Right 3 Right SELECT l.id, l.value, r.id, r.value FROM left AS l INNER JOIN right AS r ON l.id = r.id Id value id value 2 Left 2 Right Id value id value 1 Left 0 - 2 Left 2 Right Id value id value 2 Left 2 Right 0 - 3 Right Id value id value 1 Left 0 - 2 Left 2 Right 0 - 3 Right [INNER] JOIN LEFT [OUTER] JOIN FULL [OUTER] JOIN RIGHT [OUTER] JOIN 43
  • 44. © 2021 Altinity, Inc. How does ClickHouse process a query with a join? Left Side Table (Big) Merged Result Filter Right Side Table (Small) In-RAM Hash Table Load the right side table Scan left side table in parallel, computing aggregates and adding joined data Merge and sort results 44
  • 45. © 2021 Altinity, Inc. Top three tips for querying data in ClickHouse ● Use time functions to pull out data grouped by time intervals ● Use aggregates to summarize data inside ClickHouse ● The big table always goes on the LEFT side of the join ○ ClickHouse cannot decide the join order [yet] for you 45
  • 46. © 2021 Altinity, Inc. © 2021 Altinity, Inc. ClickHouse Performance Basic Self-Defense 46
  • 47. © 2021 Altinity, Inc. ClickHouse performance in four easy steps ● Add more CPU ● Limit columns and rows in queries ● Fix table design ● Store data more efficiently on disk (or SSD) 47
  • 48. © 2021 Altinity, Inc. Add more compute using max_threads property SELECT toYear(FlightDate) year, sum(Cancelled)/count(*) cancelled, sum(DepDel15)/count(*) delayed_15 FROM airline.ontime GROUP BY year ORDER BY year LIMIT 10 SET max_threads = 2 SET max_threads = 4 . . . max_threads defaults to half the number of CPU cores 48
  • 49. © 2021 Altinity, Inc. (Log messages) Selected 2 parts by date, 2 parts by key, 73 marks to read from 2 ranges Read fewer rows to get better performance SELECT FlightDate, count(*) AS total_flights, sum(Cancelled) / count(*) AS cancelled, sum(DepDel15) / count(*) AS delayed_15 FROM airline.ontime WHERE (FlightDate >= toDate('2016-01-01')) AND (FlightDate <= toDate('2016-02-10')) GROUP BY FlightDate 49
  • 50. © 2021 Altinity, Inc. Understanding what’s going on in MergeTree /var/lib/clickhouse/data/airline/ontime 2017-07-01 AA 2017-07-01 EV 2017-07-01 UA 2017-07-02 AA ... primary.idx | | | | .mrk .bin 20170701_20170731_355_355_2/ (FlightDate, Carrier...) ActualElapsedTime Airline AirlineID... | | | | .mrk .bin | | | | .mrk .bin Granule Compressed Block Mark 50
  • 51. © 2021 Altinity, Inc. CREATE TABLE ontime ( `Year` UInt16, `Quarter` UInt8, . . . ) ENGINE = MergeTree PARTITION BY Year PRIMARY KEY (Carrier, FlightDate) ORDER BY (Carrier, FlightDate, DepTime) Ensure table design is optimal for queries 51 Results in ~125 parts for this dataset, avg 107MB per part Use columns you filter on Order columns by increasing cardinality* left to right *Cardinality = How many unique values in column
  • 52. © 2021 Altinity, Inc. Finding out column compression level SELECT formatReadableSize(sum(data_compressed_bytes)) AS tc, formatReadableSize(sum(data_uncompressed_bytes)) AS tu, sum(data_compressed_bytes) / sum(data_uncompressed_bytes) AS ratio FROM system.columns WHERE database = currentDatabase() AND (table = 'ontime') AND (name = 'TailNum') ┌─tc────────┬─tu────────┬──────────────ratio─┐ │ 19.33 MiB │ 37.80 MiB │ 0.5112778354359176 │ └───────────┴───────────┴────────────────────┘ 52
  • 53. © 2021 Altinity, Inc. Make a column smaller with compression ┌─TailNum─┐ │ N3HYAA │ │ N377AA │ │ N377AA │ │ N922AA │ │ N862AA │ │ N3EEAA │ │ N536AA │ │ N665AA │ │ N862AA │ │ N936AA │ │ N4YBAA │ └─────────┘ 53 Compression reduces a string of bits to a different and hopefully smaller string of bits LZ4 Compression Fast to compress and decompress. Default for ClickHouse ZSTD Compression Slower to compress but generally smaller than LZ4. You have to ask for it
  • 54. © 2021 Altinity, Inc. Codecs reduce data before compression N862AA Value LowCardinality encoding ZSTD(1) compression 351 Smaller Value Something very small! Turns each string into an integer Aka Dictionary Encoding 6 bytes 2 bytes 54
  • 55. © 2021 Altinity, Inc. Overview of encodings Name Best for LowCardinality Strings with fewer than 10K values Delta Time series Double Delta Increasing counters Gorilla Gauge data (bounces around mean) T64 Integers other than random hashes Codec compression may vary between LZ4 and ZSTD 55
  • 56. © 2021 Altinity, Inc. How to add codecs and change compression ALTER TABLE ontime MODIFY COLUMN TailNum LowCardinality(String) CODEC(ZSTD(1)) ALTER TABLE ontime MODIFY COLUMN Year CODEC(DoubleDelta, ZSTD(1)) -- Force ClickHouse to change data ALTER TABLE ontime UPDATE TailNum = TailNum, Year = Year WHERE 1 56
  • 57. © 2021 Altinity, Inc. Effect of codec and compression changes 57
  • 58. © 2021 Altinity, Inc. © 2021 Altinity, Inc. Getting started on applications 58
  • 59. © 2021 Altinity, Inc. Where is the software? (All open source!) 59 Event streaming ● Apache Kafka ● Apache Pulsar ● Vectorized Redpanda ELT ● Apache Airflow ● Rudderstack Rendering/Display ● Apache Superset ● Cube.js ● Grafana Client Libraries ● C++ - ClickHouse CPP ● Golang - ClickHouse Go ● Java - ClickHouse JDBC ● Javascript/Node.js - Apla ● ODBC - ODBC Driver for ClickHouse ● Python - ClickHouse Driver, ClickHouse SQLAlchemy More client library links HERE Kubernetes ● Altinity Operator for ClickHouse
  • 60. © 2021 Altinity, Inc. Where is the documentation? ClickHouse official docs – https://clickhouse.com/docs/ Altinity Blog – https://altinity.com/blog/ Altinity Youtube Channel – https://www.youtube.com/channel/UCE3Y2lDKl_ZfjaCrh62onYA Altinity Knowledge Base – https://kb.altinity.com/ Meetups, other blogs, and external resources. Use your powers of Search! 60
  • 61. © 2021 Altinity, Inc. Where can I get help? Telegram - ClickHouse Channel Slack ● ClickHouse Public Workspace - clickhousedb.slack.com ● Altinity Public Workspace - altinitydbworkspace.slack.com Education - Altinity ClickHouse Training Support - Altinity offers support for ClickHouse in all environments 61
  • 62. © 2021 Altinity, Inc. Thank you and good luck! https://altinity.com 62