Professional Documents
Culture Documents
Architecture
Ryan Roelke
Senior Software Engineer
Vertica Architecture
Key aspects of Vertica’s design
Database background
An Analytic Query in 2005 (Industry)
An Analytic Query in 2005 (Academia)
An Analytic Query in 2020 (Vertica)
3
https://www.visualcapitalist.com/what-happens-in-an-internet-minute-in-2019/
OLTP (On-Line Transaction Processing)
Key-value queries
Lots of small, incremental
changes
- Update to an inventory or bank
account
Traditional workload
https://www.visualcapitalist.com/what-happens-in-an-internet-minute-in-2019/
OLTP (On-Line Transaction Processing)
CREATE TABLE accounts (
user_id INTEGER,
user_name VARCHAR(128),
balance INTEGER,
…
);
UPDATE accounts
SET balance = balance + 10
WHERE user_id = 123456789;
https://www.visualcapitalist.com/what-happens-in-an-internet-minute-in-2019/
OLAP (On-Line Analytical Processing)
Identify trends in data over time
Use data for decision-making
- Failure prevention or detection
Big Data!
https://www.visualcapitalist.com/what-happens-in-an-internet-minute-in-2019/
OLAP (On-Line Analytical Processing)
CREATE TABLE searches(
timestamp TIMESTAMP,
user_id INTEGER,
...
);
SELECT
hour(timestamp),
count(distinct user_id)
FROM searches
GROUP BY hour(timestamp);
https://www.visualcapitalist.com/what-happens-in-an-internet-minute-in-2019/
Rewind to 2005
"Big Data" is not a term on anyone's radar
"The Cloud" is also not on anyone's radar
What is your database doing?
- OLTP
- OLAP is not mainstream yet
1 An Analytic Query in 2005
Example – Stock Prices
10
Example – Stock Prices
stockprices.txt
GOOGL, 1000, …, …, …, …, …, …, …, …, …, 04.02.2005-14:00:00,
AAPL, 192, …, …, …, …, …, …, …, …, …, 04.02.2005-14:02:00,
GOOGL, 1010, …, …, …, …, …, …, …, …, …, 04.03.2005-09:00:00,
AAPL, 193, …, …, …, …, …, …, …, …, …, 04.03.2005-09:03:00,
…
…
…
…
11
Example – Stock Prices
stockprices.txt
GOOGL, 1000, …, …, 04.02.2005-14:00:00,
AAPL, 192, …, …, 04.02.2005-14:02:00,
Index GOOGL, 1010, …, …, 04.03.2005-09:01:00,
AAPL, 04.02.2005-14:02:00
AAPL, 04.03.2005-09:03:00 AAPL, 197, …, …, 04.03.2005-09:03:00,
GOOGL, 04.02.2005-14:00:00
GOOGL, 04.03.2005-09:01:00 …
…
…
…
12
Example – Stock Prices
▪ UPDATE stockprices
SET price = price + 1
WHERE symbol = 'AAPL'
AND timestamp = '04.03.2005-09:03:00';
stockprices.txt
GOOGL, 1000, …, …, 04.02.2005-14:00:00,
Index AAPL, 192, …, …, 04.02.2005-14:02:00,
AAPL, 04.02.2005-14:02:00
AAPL, 04.03.2005-09:03:00 GOOGL, 1010, …, …, 04.03.2005-09:01:00,
GOOGL, 04.02.2005-14:00:00
GOOGL, 04.03.2005-09:01:00 AAPL, 198, …, …, 04.03.2005-09:03:00
…
13
Example – Stock Prices
▪ SELECT avg(price) FROM stocks
WHERE symbol = 'AAPL'
AND date(timestamp) = '04.02.2019';
stockprices.txt
GOOGL, 1000, …, …, 04.02.2005-14:00:00,
Index AAPL, 192, …, …, 04.02.2005-14:02:00,
AAPL, 04.02.2005-14:02:00
AAPL, 04.03.2005-09:03:00 GOOGL, 1010, …, …, 04.03.2005-09:01:00,
GOOGL, 04.02.2005-14:00:00
GOOGL, 04.03.2005-09:01:00 AAPL, 198, …, …, 04.03.2005-09:03:00,
…
14
Example – Stock Prices
stockprices.txt
GOOGL, 1000, …, …, …, …, …, …, …, …, …, 04.02.2005-14:00:00,
AAPL, 192, …, …, …, …, …, …, …, …, …, 04.02.2005-14:02:00,
GOOGL, 1010, …, …, …, …, …, …, …, …, …, 04.03.2005-09:00:00,
AAPL, 193, …, …, …, …, …, …, …, …, …, 04.03.2005-09:03:00,
… … …, …, …, …, …, …, …, …, …, …,
… … …, …, …, …, …, …, …, …, …, …,
… … …, …, …, …, …, …, …, …, …, …,
… … …, …, …, …, …, …, …, …, …, …,
… … …, …, …, …, …, …, …, …, …, …,
… … …, …, …, …, …, …, …, …, …, …,
… … …, …, …, …, …, …, …, …, …, …,
… … …, …, …, …, …, …, …, …, …, …,
… … …, …, …, …, …, …, …, …, …, …,
Index …
…
…
…
…, …, …, …, …, …, …, …, …, …,
…, …, …, …, …, …, …, …, …, …,
AAPL, 04.02.2005-14:02:00 … … …, …, …, …, …, …, …, …, …, …,
AAPL, 04.03.2005-09:03:00
GOOGL, 04.02.2005-14:00:00 … … …, …, …, …, …, …, …, …, …, …,
GOOGL, 04.03.2005-09:01:00 … … …, …, …, …, …, …, …, …, …, …,
…
… … … …, …, …, …, …, …, …, …, …, …,
… … … …, …, …, …, …, …, …, …, …, …,
…
… … …, …, …, …, …, …, …, …, …, …,
… … …, …, …, …, …, …, …, …, …, …,
… … …, …, …, …, …, …, …, …, …, …,
… … …, …, …, …, …, …, …, …, …, …,
… … …, …, …, …, …, …, …, …, …, …,
… … …, …, …, …, …, …, …, …, …, …,
… … …, …, …, …, …, …, …, …, …, …,
… … …, …, …, …, …, …, …, …, …, …,
… … …, …, …, …, …, …, …, …, …, …,
… … …, …, …, …, …, …, …, …, …, …,
… … …, …, …, …, …, …, …, …, …, …
15
An Analytic Query in 2005:
2
Academia
The C-Store Paper
Memory Hierarchy
Source: https://cs61.seas.harvard.edu/cs61wiki/images/2/28/Architecture.pdf
18
Stock Prices in C-Store (1)
19
Stock Prices in C-Store (1)
▪ SELECT avg(price) FROM stocks
WHERE symbol = 'AAPL'
AND date(timestamp) = '04.02.2019';
20
Stock Prices in C-Store (1)
symbol values timestamp
GOOGL 1000 04.02.2005-14:00:00
AAPL 192 04.02.2005-14:03:00
GOOGL 1010 04.03.2005-09:01:00
AAPL 198 04.03.2005-09:03:00
… … …
… … …
… … …
… … …
… … …
… … …
… … …
… … …
… … …
… … …
…
…
…
…
…
…
... ... ... ... …
…
…
… … …
… … …
… … …
… … …
… … …
… … …
… … …
… … …
… … …
… … …
… … …
… … …
… … …
… … …
… … …
21
Stock Prices in C-Store (2)
GOOGL 1000 04.02.2005-14:00:00
AAPL 192 04.02.2005-14:03:00
GOOGL 1010 04.03.2005-09:01:00
AAPL 198 04.03.2005-09:03:00
... ... ...
How does Vertica build upon the C-Store design to solve its problems?
- Provide tools for users to customize their storage
What is Vertica?
How does Vertica build upon the C-Store design to solve its problems?
- One Design Does Not Fit All:
Provides tools for users to customize their storage
- One Server Does Not Fit All:
Coordinates data and load distribution in a multi-node system
- One Deployment Does Not Fit All:
Eschews commodity hardware and offers features targeted at the cloud
One Design Does Not Fit All
Table is a logical idea
- Column specification doesn't tell you how they are stored
Vertica Node
Vertica Node Vertica Node
Storage
Storage Storage
One Server Does Not Fit All
Projections can be segmented,
mapping row to node based on some
property of the row
Projections have K-safety, which sets
data redundancy
hash(symbol) 0212348234
858993459
0 N1 N2 1717986918
N5 N3
N4
3435973836 2576980377
One Deployment Does Not Fit All
Vertica Eon Mode
- Designed for cloud integration and rapidly-
changing cluster sizes
Learn more at the breakout session
"Eon Mode: Past, Present and Future"
Vertica – Further Reading
Conference publications
- C-Store: http://db.csail.mit.edu/projects/cstore/vldb.pdf
- Vertica Seven Years Later:
http://vldb.org/pvldb/vol5/p1790_andrewlamb_vldb2012.pdf
- Eon Mode: https://www.vertica.com/wp-
content/uploads/2018/05/Vertica_EON_SIGMOD_Paper.pdf
Vertica Documentation
- https://www.vertica.com/docs/9.3.x/HTML/Content/Home.htm
44
Learn More: academy.vertica.com
Try it Free: vertica.com/try