SlideShare a Scribd company logo
@cockroachdb
PostgreSQL meetup, November 2015
CockroachDB
presented by Peter Mattis / Co-Founder
@cockroachdb
1.Overview of CockroachDB
2.SQL Data Model
3.Logical Data Storage
4.Online/Concurrent Schema Change
Agenda
@cockroachdb
What is CockroachDB?
■Scale out SQL
■Distributed
■Survivable
■Consistent
■Open source
@cockroachdb
CockroachDB: Architecture
■Layered abstractions
■SQL is starting point
■Distributes at map
■Replicates at physical layer
SQL
Transactional KV
Monolithic Map
Raft
@cockroachdb
CockroachDB: Architecture
■Layered abstractions
■SQL is starting point
■Distributes at map
■Replicates at physical layer
Transactional KV
Monolithic Map
Raft
GraphSQL
@cockroachdb
CockroachDB: Architecture
■Layered abstractions
■SQL is starting point
■Distributes at map
■Replicates at physical layer
Transactional KV
Monolithic Map
Raft
SQL Graph Doc
@cockroachdb
CockroachDB: Architecture
■Layered abstractions
■SQL is starting point
■Distributes at map
■Replicates at physical layer
Transactional KV
Monolithic Map
Raft
SQL
@cockroachdb
CockroachDB: Architecture
■Layered abstractions
■SQL is starting point
■Distributes at map
■Replicates at physical layer
Transactional KV
Monolithic Map
Raft
SQL
Physical
@cockroachdb
SQL Data Model
@cockroachdb
■Tables
SQL Data Model
@cockroachdb
■Tables
SQL Data Model
Inventory
@cockroachdb
■Tables
■Rows
SQL Data Model
Inventory
@cockroachdb
■Tables
■Rows
■Columns
SQL Data Model
Inventory
ID Name Price
1 Glove 1.11
2 Ball 2.22
3 Shirt 3.33
4 Shorts 4.44
5 Bat 5.55
6 Shoes 6.66
@cockroachdb
■Tables
■Rows
■Columns
■Indexes
SQL Data Model
Inventory
ID Name Price
1 Glove 1.11
2 Ball 2.22
3 Shirt 3.33
4 Shorts 4.44
5 Bat 5.55
6 Shoes 6.66
Name
Ball
Bat
Glove
Shirt
Shoes
Shorts
Name_Idx
@cockroachdb
PostgreSQL: Logical Data Storage
@cockroachdb
■Rows are stored in an unordered heap
■Indexes are btrees
■Primary key is a unique index
PostgreSQL: Data Storage
@cockroachdb
CREATE TABLE test (
id INTEGER PRIMARY KEY,
name VARCHAR,
price FLOAT,
);
PostgreSQL: Example Table
@cockroachdb
INSERT INTO test VALUES (1, “ball”, 3.33);
PostgreSQL: Logical Data Storage
@cockroachdb
INSERT INTO test VALUES (1, “ball”, 3.33);
PostgreSQL: Logical Data Storage
Tuple ID (Page# / Item#) Row
(0, 1) (1, “ball”, 3.33)
test (heap)
@cockroachdb
INSERT INTO test VALUES (1, “ball”, 3.33);
PostgreSQL: Logical Data Storage
Tuple ID (Page# / Item#) Row
(0, 1) (1, “ball”, 3.33)
Index Key Tuple ID
1 (0, 1)
test (heap)test_pkey (btree)
@cockroachdb
INSERT INTO test VALUES (1, “ball”, 3.33);
INSERT INTO test VALUES (2, “glove”, 4.44);
PostgreSQL: Logical Data Storage
Tuple ID (Page# / Item#) Row
(0, 1) (1, “ball”, 3.33)
(0, 2) (2, “glove”, 4.44)
Index Key Tuple ID
1 (0, 1)
2 (0, 2)
test (heap)test_pkey (btree)
@cockroachdb
CockroachDB: Logical Data Storage
@cockroachdb
■Keys and values are strings
■Monolithic, sorted map
CockroachDB: KV
@cockroachdb
Get(key)
Put(key, value)
ConditionalPut(key, value, expValue)
Scan(startKey, endKey)
CockroachDB: KV Primitives
@cockroachdb
Get(key)
Put(key, value)
ConditionalPut(key, value, expValue)
Scan(startKey, endKey)
Del(key)
CockroachDB: KV Primitives
@cockroachdb
■All tables have a primary key
■One key/value pair per column
CockroachDB: Row Storage
@cockroachdb
■All tables have a primary key
■One key/value pair per column
■Key anatomy:
/<table>/<index>/<pkey>/<column>
CockroachDB: Row Storage
@cockroachdb
CREATE TABLE test (
id INTEGER PRIMARY KEY,
name VARCHAR,
price FLOAT,
);
CockroachDB: Example Table
@cockroachdb
INSERT INTO test VALUES (1, “ball”, 2.22);
CockroachDB: Key Anatomy
Key: /<table>/<index>/<key>/<column> Value
/test/primary/1/name “ball”
/test/primary/1/price 2.22
@cockroachdb
INSERT INTO test VALUES (1, “ball”, 2.22);
INSERT INTO test VALUES (2, “glove”, 3.33);
CockroachDB: Key Anatomy
Key: /<table>/<index>/<key>/<column> Value
/test/primary/1/name “ball”
/test/primary/1/price 2.22
/test/primary/2/name “glove”
/test/primary/2/price 3.33
@cockroachdb
INSERT INTO test VALUES (1, “ball”, 2.22);
INSERT INTO test VALUES (2, “glove”, 3.33);
CockroachDB: Key Anatomy
Key: /<table>/<index>/<key>/<column> Value
/test/primary/1/name “ball”
.../price 2.22
.../2/name “glove”
.../price 3.33
@cockroachdb
INSERT INTO test VALUES (1, “ball”, 2.22);
INSERT INTO test VALUES (2, “glove”, 3.33);
CockroachDB: Key Anatomy
Key: /<table>/<index>/<key>/<column> Value
/1000/1/1/1 “ball”
.../2 2.22
.../2/1 “glove”
.../2 3.33
@cockroachdb
■Key encoding
■NULL column values
■Unique indexes
■Non-unique indexes
CockroachDB: The Details
@cockroachdb
■Keys and values are strings
■Columns are typed data
■???
CockroachDB: Key Encoding
@cockroachdb
■NULL indicates value does not exist
■NULL is weird: NULL != NULL
CockroachDB: NULL Column Values
@cockroachdb
■NULL indicates value does not exist
■NULL is weird: NULL != NULL
■CockroachDB: NULL values are not explicitly stored
CockroachDB: NULL Column Values
@cockroachdb
INSERT INTO test VALUES (1, “ball”, NULL);
CockroachDB: NULL Column Values
Key: /<table>/<index>/<key>/<column> Value
/test/primary/1/name “ball”
@cockroachdb
INSERT INTO test VALUES (1, “ball”, NULL);
INSERT INTO test VALUES (2, NULL, NULL);
CockroachDB: NULL Column Values
Key: /<table>/<index>/<key>/<column> Value
/test/primary/1/name “ball”
??? ???
@cockroachdb
INSERT INTO test VALUES (1, “ball”, NULL);
INSERT INTO test VALUES (2, NULL, NULL);
CockroachDB: NULL Column Values
Key: /<table>/<index>/<key>[/<column>] Value
/test/primary/1 Ø
/test/primary/1/name “ball”
/test/primary/2 Ø
@cockroachdb
CREATE UNIQUE INDEX bar ON test (name);
■Multiple table rows with equal indexed values are
not allowed
CockroachDB: Unique Indexes
@cockroachdb
CREATE UNIQUE INDEX bar ON test (name);
INSERT INTO test VALUES (1, “ball”, 2.22);
CockroachDB: Unique Indexes
Key: /<table>/<index>/<key> Value
/test/bar/”ball” 1
@cockroachdb
CREATE UNIQUE INDEX bar ON test (name);
INSERT INTO test VALUES (1, “ball”, 2.22);
INSERT INTO test VALUES (2, “glove”, 3.33);
CockroachDB: Unique Indexes
Key: /<table>/<index>/<key> Value
/test/bar/”ball” 1
/test/bar/”glove” 2
@cockroachdb
CREATE UNIQUE INDEX bar ON test (name);
INSERT INTO test VALUES (1, “ball”, 2.22);
INSERT INTO test VALUES (2, “glove”, 3.33);
INSERT INTO test VALUES (3, “glove”, 4.44);
CockroachDB: Unique Indexes
Key: /<table>/<index>/<key> Value
/test/bar/”ball” 1
/test/bar/”glove” 2
/test/bar/”glove” 3
@cockroachdb
CREATE UNIQUE INDEX bar ON test (name);
■NULL is weird: NULL != NULL
CockroachDB: Unique Indexes (NULL Values)
@cockroachdb
CREATE UNIQUE INDEX bar ON test (name);
INSERT INTO test VALUES (3, NULL, NULL);
CockroachDB: Unique Indexes (NULL Values)
Key: /<table>/<index>/<key> Value
/test/bar/NULL 3
@cockroachdb
CREATE UNIQUE INDEX bar ON test (name);
INSERT INTO test VALUES (3, NULL, NULL);
INSERT INTO test VALUES (4, NULL, NULL);
CockroachDB: Unique Indexes (NULL Values)
Key: /<table>/<index>/<key> Value
/test/bar/NULL 3
/test/bar/NULL 4
@cockroachdb
CREATE UNIQUE INDEX bar ON test (name);
INSERT INTO test VALUES (3, NULL, NULL);
CockroachDB: Unique Indexes (NULL Values)
Key: /<table>/<index>/<key>[/<pkey>] Value
/test/bar/NULL/3 Ø
@cockroachdb
CREATE UNIQUE INDEX bar ON test (name);
INSERT INTO test VALUES (3, NULL, NULL);
INSERT INTO test VALUES (4, NULL, NULL);
CockroachDB: Unique Indexes (NULL Values)
Key: /<table>/<index>/<key>[/<pkey>] Value
/test/bar/NULL/3 Ø
/test/bar/NULL/4 Ø
@cockroachdb
CREATE INDEX foo ON test (name);
■Multiple table rows with equal indexed values are
allowed
CockroachDB: Non-Unique Indexes
@cockroachdb
CREATE INDEX foo ON test (name);
■Multiple table rows with equal indexed values are
allowed
■Primary key is a unique index
CockroachDB: Non-Unique Indexes
@cockroachdb
CREATE INDEX foo ON test (name);
INSERT INTO test VALUES (1, “ball”, 2.22);
CockroachDB: Non-Unique Indexes
Key: /<table>/<index>/<key>/<pkey> Value
/test/foo/”ball”/1 Ø
@cockroachdb
CREATE INDEX foo ON test (name);
INSERT INTO test VALUES (1, “ball”, 2.22);
INSERT INTO test VALUES (2, “glove”, 3.33);
CockroachDB: Non-Unique Indexes
Key: /<table>/<index>/<key>/<pkey> Value
/test/foo/”ball”/1 Ø
/test/foo/”glove”/2 Ø
@cockroachdb
CREATE INDEX foo ON test (name);
INSERT INTO test VALUES (1, “ball”, 2.22);
INSERT INTO test VALUES (2, “glove”, 3.33);
INSERT INTO test VALUES (3, “glove”, 4.44);
CockroachDB: Non-Unique Indexes
Key: /<table>/<index>/<key>/<pkey> Value
/test/foo/”ball”/1 Ø
/test/foo/”glove”/2 Ø
/test/foo/”glove”/3 Ø
@cockroachdb
■Keys and values are strings
■NULL column values
■Unique indexes
■Non-unique indexes
CockroachDB: Logical Data Storage
@cockroachdb
Logical Data Storage
PostgreSQL CockroachDB
Keys are composite structures Keys are strings
Heap storage for rows Required primary key
Per-table heap/indexes Monolithic map
@cockroachdb
Online Schema Change
@cockroachdb
Schema Change Operations
CREATE INDEX foo ON test (col1, col2, …);
ALTER TABLE test DROP col1;
ALTER TABLE test ADD col3 INTEGER;
...
@cockroachdb
Schema Change (the easy way)
1. Lock table
2. Adjust table data (add column, populate index, etc.)
3. Unlock table
@cockroachdb
Schema Change (the easy way)
1. Apologize for down time
2. Lock table
3. Adjust table data (add column, populate index, etc.)
4. Unlock table
@cockroachdb
Schema Change (the MySQL way)
1. Create new table with altered schema
2. Capture changes from source to the new table
3. Copy rows from the source to the new table
4. Synchronize source and new table
5. Swap/rename source and new table
@cockroachdb
Schema Change (the PostgreSQL way)
1. CREATE INDEX CONCURRENTLY
@cockroachdb
CockroachDB: Schema Change
■TableDescriptor contains table schema
■TableDescriptor replicated on every node
■Distributed atomic updates are difficult
■Distributed locking is difficult
■The easy way isn’t feasible
@cockroachdb
CockroachDB: CREATE INDEX
CREATE INDEX foo ON TEST
1. Backfill index entries
2. Add index to TableDescriptor
@cockroachdb
CockroachDB: CREATE INDEX
T1 T2
CREATE INDEX foo ON test… INSERT INTO test…
@cockroachdb
CockroachDB: CREATE INDEX
CREATE INDEX foo ON TEST
1. Add index to TableDescriptor as write-only
2. Backfill index entries
3. Mark index as read-write
@cockroachdb
CockroachDB: CREATE INDEX
T1 T2
CREATE INDEX foo ON test… INSERT INTO test…
or
UPDATE test…
or
DELETE FROM test…
@cockroachdb
CockroachDB: CREATE INDEX
CREATE INDEX foo ON TEST
1. Add index to TableDescriptor as delete-only
2. Wait for descriptor propagation
3. Mark index as write-only
4. Wait for descriptor propagation
5. Backfill index entries
6. Mark index as read-write
@cockroachdb
Online Schema Change
Online schema change is difficult
The database should do the heavy lifting
@cockroachdb
The End
SQL databases are KV stores on steroids
@cockroachdb
github.com/cockroachdb/cockroach
CockroachLabs.com
@cockroachdb
Thank You
Ad

Recommended

CockroachDB: Architecture of a Geo-Distributed SQL Database
CockroachDB: Architecture of a Geo-Distributed SQL Database
C4Media
 
Tech Talk: RocksDB Slides by Dhruba Borthakur & Haobo Xu of Facebook
Tech Talk: RocksDB Slides by Dhruba Borthakur & Haobo Xu of Facebook
The Hive
 
Real-time Analytics with Trino and Apache Pinot
Real-time Analytics with Trino and Apache Pinot
Xiang Fu
 
Flink powered stream processing platform at Pinterest
Flink powered stream processing platform at Pinterest
Flink Forward
 
An Enterprise Architect's View of MongoDB
An Enterprise Architect's View of MongoDB
MongoDB
 
Understanding Query Plans and Spark UIs
Understanding Query Plans and Spark UIs
Databricks
 
Ceph and RocksDB
Ceph and RocksDB
Sage Weil
 
The Parquet Format and Performance Optimization Opportunities
The Parquet Format and Performance Optimization Opportunities
Databricks
 
Cassandra serving netflix @ scale
Cassandra serving netflix @ scale
Vinay Kumar Chella
 
What’s the Best PostgreSQL High Availability Framework? PAF vs. repmgr vs. Pa...
What’s the Best PostgreSQL High Availability Framework? PAF vs. repmgr vs. Pa...
ScaleGrid.io
 
Under The Hood Of A Shard-Per-Core Database Architecture
Under The Hood Of A Shard-Per-Core Database Architecture
ScyllaDB
 
Introduction to PySpark
Introduction to PySpark
Russell Jurney
 
Introduction to Kafka Cruise Control
Introduction to Kafka Cruise Control
Jiangjie Qin
 
Apache Spark Core—Deep Dive—Proper Optimization
Apache Spark Core—Deep Dive—Proper Optimization
Databricks
 
Introduction to MongoDB
Introduction to MongoDB
Ravi Teja
 
MariaDB 10.11 key features overview for DBAs
MariaDB 10.11 key features overview for DBAs
Federico Razzoli
 
Troubleshooting Complex Performance issues - Oracle SEG$ contention
Troubleshooting Complex Performance issues - Oracle SEG$ contention
Tanel Poder
 
The Full MySQL and MariaDB Parallel Replication Tutorial
The Full MySQL and MariaDB Parallel Replication Tutorial
Jean-François Gagné
 
Introduction to MongoDB
Introduction to MongoDB
Mike Dirolf
 
MySQL GTID Concepts, Implementation and troubleshooting
MySQL GTID Concepts, Implementation and troubleshooting
Mydbops
 
Practical learnings from running thousands of Flink jobs
Practical learnings from running thousands of Flink jobs
Flink Forward
 
Introduction to Redis
Introduction to Redis
Maarten Smeets
 
Backup and-recovery2
Backup and-recovery2
Command Prompt., Inc
 
MyRocks Deep Dive
MyRocks Deep Dive
Yoshinori Matsunobu
 
Spark
Spark
Heena Madan
 
Introduction to Cassandra
Introduction to Cassandra
Gokhan Atil
 
Processing Large Data with Apache Spark -- HasGeek
Processing Large Data with Apache Spark -- HasGeek
Venkata Naga Ravi
 
Cassandra Introduction & Features
Cassandra Introduction & Features
DataStax Academy
 
RocksDB storage engine for MySQL and MongoDB
RocksDB storage engine for MySQL and MongoDB
Igor Canadi
 
Why go ?
Why go ?
Mailjet
 

More Related Content

What's hot (20)

Cassandra serving netflix @ scale
Cassandra serving netflix @ scale
Vinay Kumar Chella
 
What’s the Best PostgreSQL High Availability Framework? PAF vs. repmgr vs. Pa...
What’s the Best PostgreSQL High Availability Framework? PAF vs. repmgr vs. Pa...
ScaleGrid.io
 
Under The Hood Of A Shard-Per-Core Database Architecture
Under The Hood Of A Shard-Per-Core Database Architecture
ScyllaDB
 
Introduction to PySpark
Introduction to PySpark
Russell Jurney
 
Introduction to Kafka Cruise Control
Introduction to Kafka Cruise Control
Jiangjie Qin
 
Apache Spark Core—Deep Dive—Proper Optimization
Apache Spark Core—Deep Dive—Proper Optimization
Databricks
 
Introduction to MongoDB
Introduction to MongoDB
Ravi Teja
 
MariaDB 10.11 key features overview for DBAs
MariaDB 10.11 key features overview for DBAs
Federico Razzoli
 
Troubleshooting Complex Performance issues - Oracle SEG$ contention
Troubleshooting Complex Performance issues - Oracle SEG$ contention
Tanel Poder
 
The Full MySQL and MariaDB Parallel Replication Tutorial
The Full MySQL and MariaDB Parallel Replication Tutorial
Jean-François Gagné
 
Introduction to MongoDB
Introduction to MongoDB
Mike Dirolf
 
MySQL GTID Concepts, Implementation and troubleshooting
MySQL GTID Concepts, Implementation and troubleshooting
Mydbops
 
Practical learnings from running thousands of Flink jobs
Practical learnings from running thousands of Flink jobs
Flink Forward
 
Introduction to Redis
Introduction to Redis
Maarten Smeets
 
Backup and-recovery2
Backup and-recovery2
Command Prompt., Inc
 
MyRocks Deep Dive
MyRocks Deep Dive
Yoshinori Matsunobu
 
Spark
Spark
Heena Madan
 
Introduction to Cassandra
Introduction to Cassandra
Gokhan Atil
 
Processing Large Data with Apache Spark -- HasGeek
Processing Large Data with Apache Spark -- HasGeek
Venkata Naga Ravi
 
Cassandra Introduction & Features
Cassandra Introduction & Features
DataStax Academy
 
Cassandra serving netflix @ scale
Cassandra serving netflix @ scale
Vinay Kumar Chella
 
What’s the Best PostgreSQL High Availability Framework? PAF vs. repmgr vs. Pa...
What’s the Best PostgreSQL High Availability Framework? PAF vs. repmgr vs. Pa...
ScaleGrid.io
 
Under The Hood Of A Shard-Per-Core Database Architecture
Under The Hood Of A Shard-Per-Core Database Architecture
ScyllaDB
 
Introduction to PySpark
Introduction to PySpark
Russell Jurney
 
Introduction to Kafka Cruise Control
Introduction to Kafka Cruise Control
Jiangjie Qin
 
Apache Spark Core—Deep Dive—Proper Optimization
Apache Spark Core—Deep Dive—Proper Optimization
Databricks
 
Introduction to MongoDB
Introduction to MongoDB
Ravi Teja
 
MariaDB 10.11 key features overview for DBAs
MariaDB 10.11 key features overview for DBAs
Federico Razzoli
 
Troubleshooting Complex Performance issues - Oracle SEG$ contention
Troubleshooting Complex Performance issues - Oracle SEG$ contention
Tanel Poder
 
The Full MySQL and MariaDB Parallel Replication Tutorial
The Full MySQL and MariaDB Parallel Replication Tutorial
Jean-François Gagné
 
Introduction to MongoDB
Introduction to MongoDB
Mike Dirolf
 
MySQL GTID Concepts, Implementation and troubleshooting
MySQL GTID Concepts, Implementation and troubleshooting
Mydbops
 
Practical learnings from running thousands of Flink jobs
Practical learnings from running thousands of Flink jobs
Flink Forward
 
Introduction to Cassandra
Introduction to Cassandra
Gokhan Atil
 
Processing Large Data with Apache Spark -- HasGeek
Processing Large Data with Apache Spark -- HasGeek
Venkata Naga Ravi
 
Cassandra Introduction & Features
Cassandra Introduction & Features
DataStax Academy
 

Viewers also liked (15)

RocksDB storage engine for MySQL and MongoDB
RocksDB storage engine for MySQL and MongoDB
Igor Canadi
 
Why go ?
Why go ?
Mailjet
 
RocksDB detail
RocksDB detail
MIJIN AN
 
Storage Engine Wars at Parse
Storage Engine Wars at Parse
MongoDB
 
Business Track: How Criteo Scaled and Supported Massive Growth with MongoDB
Business Track: How Criteo Scaled and Supported Massive Growth with MongoDB
MongoDB
 
MongoDB Wins
MongoDB Wins
Noreen Seebacher
 
Criteo Couchbase live 2015
Criteo Couchbase live 2015
Nicolasgmail.com Helleringer
 
RocksDB compaction
RocksDB compaction
MIJIN AN
 
1 Million Writes per second on 60 nodes with Cassandra and EBS
1 Million Writes per second on 60 nodes with Cassandra and EBS
Jim Plush
 
How companies use NoSQL and Couchbase
How companies use NoSQL and Couchbase
Dipti Borkar
 
Couchbase live 2016
Couchbase live 2016
Pierre Mavro
 
Node.js - As a networking tool
Node.js - As a networking tool
Felix Geisendörfer
 
Spark SQL Deep Dive @ Melbourne Spark Meetup
Spark SQL Deep Dive @ Melbourne Spark Meetup
Databricks
 
Cassandra and Docker Lessons Learned
Cassandra and Docker Lessons Learned
DataStax Academy
 
Road to Analytics
Road to Analytics
Datio Big Data
 
RocksDB storage engine for MySQL and MongoDB
RocksDB storage engine for MySQL and MongoDB
Igor Canadi
 
Why go ?
Why go ?
Mailjet
 
RocksDB detail
RocksDB detail
MIJIN AN
 
Storage Engine Wars at Parse
Storage Engine Wars at Parse
MongoDB
 
Business Track: How Criteo Scaled and Supported Massive Growth with MongoDB
Business Track: How Criteo Scaled and Supported Massive Growth with MongoDB
MongoDB
 
RocksDB compaction
RocksDB compaction
MIJIN AN
 
1 Million Writes per second on 60 nodes with Cassandra and EBS
1 Million Writes per second on 60 nodes with Cassandra and EBS
Jim Plush
 
How companies use NoSQL and Couchbase
How companies use NoSQL and Couchbase
Dipti Borkar
 
Couchbase live 2016
Couchbase live 2016
Pierre Mavro
 
Spark SQL Deep Dive @ Melbourne Spark Meetup
Spark SQL Deep Dive @ Melbourne Spark Meetup
Databricks
 
Cassandra and Docker Lessons Learned
Cassandra and Docker Lessons Learned
DataStax Academy
 
Ad

Similar to PostgreSQL and CockroachDB SQL (20)

PetToyPetOwnerPetPetFoodToyIdTag10, 10-n, .docx
PetToyPetOwnerPetPetFoodToyIdTag10, 10-n, .docx
herbertwilson5999
 
CockroachDB
CockroachDB
andrei moga
 
NoSQL Data Modeling 101
NoSQL Data Modeling 101
ScyllaDB
 
Postgres index types
Postgres index types
Louise Grandjonc
 
Breadth or Depth: What's in a column-store?
Breadth or Depth: What's in a column-store?
Jeff Smith
 
Real data models of silicon valley
Real data models of silicon valley
Patrick McFadin
 
Cassandra Summit 2014: Real Data Models of Silicon Valley
Cassandra Summit 2014: Real Data Models of Silicon Valley
DataStax Academy
 
Wide Column Store NoSQL vs SQL Data Modeling
Wide Column Store NoSQL vs SQL Data Modeling
ScyllaDB
 
Data Management for Quantitative Biology - Database Systems (continued) LIMS ...
Data Management for Quantitative Biology - Database Systems (continued) LIMS ...
QBiC_Tue
 
Kyotoproducts
Kyotoproducts
Mikio Hirabayashi
 
sanya's Bug database
sanya's Bug database
sanyabhasin18
 
Taming NoSQL with Spring Data
Taming NoSQL with Spring Data
Sergi Almar i Graupera
 
The State of NoSQL
The State of NoSQL
Ben Scofield
 
Apache Cassandra - Data modelling
Apache Cassandra - Data modelling
Alex Thompson
 
Become a super modeler
Become a super modeler
Patrick McFadin
 
Large Scale Accumulo Clusters
Large Scale Accumulo Clusters
Aaron Cordova
 
Accumulo Summit 2014: Four Orders of Magnitude: Running Large Scale Accumulo ...
Accumulo Summit 2014: Four Orders of Magnitude: Running Large Scale Accumulo ...
Accumulo Summit
 
Rob Sullivan at Heroku's Waza 2013: Your Database -- A Story of Indifference
Rob Sullivan at Heroku's Waza 2013: Your Database -- A Story of Indifference
Heroku
 
Cassandra Explained
Cassandra Explained
Eric Evans
 
Data storage systems
Data storage systems
delimitry
 
PetToyPetOwnerPetPetFoodToyIdTag10, 10-n, .docx
PetToyPetOwnerPetPetFoodToyIdTag10, 10-n, .docx
herbertwilson5999
 
NoSQL Data Modeling 101
NoSQL Data Modeling 101
ScyllaDB
 
Breadth or Depth: What's in a column-store?
Breadth or Depth: What's in a column-store?
Jeff Smith
 
Real data models of silicon valley
Real data models of silicon valley
Patrick McFadin
 
Cassandra Summit 2014: Real Data Models of Silicon Valley
Cassandra Summit 2014: Real Data Models of Silicon Valley
DataStax Academy
 
Wide Column Store NoSQL vs SQL Data Modeling
Wide Column Store NoSQL vs SQL Data Modeling
ScyllaDB
 
Data Management for Quantitative Biology - Database Systems (continued) LIMS ...
Data Management for Quantitative Biology - Database Systems (continued) LIMS ...
QBiC_Tue
 
sanya's Bug database
sanya's Bug database
sanyabhasin18
 
The State of NoSQL
The State of NoSQL
Ben Scofield
 
Apache Cassandra - Data modelling
Apache Cassandra - Data modelling
Alex Thompson
 
Large Scale Accumulo Clusters
Large Scale Accumulo Clusters
Aaron Cordova
 
Accumulo Summit 2014: Four Orders of Magnitude: Running Large Scale Accumulo ...
Accumulo Summit 2014: Four Orders of Magnitude: Running Large Scale Accumulo ...
Accumulo Summit
 
Rob Sullivan at Heroku's Waza 2013: Your Database -- A Story of Indifference
Rob Sullivan at Heroku's Waza 2013: Your Database -- A Story of Indifference
Heroku
 
Cassandra Explained
Cassandra Explained
Eric Evans
 
Data storage systems
Data storage systems
delimitry
 
Ad

Recently uploaded (20)

Reducing Conflicts and Increasing Safety Along the Cycling Networks of East-F...
Reducing Conflicts and Increasing Safety Along the Cycling Networks of East-F...
Safe Software
 
Data Validation and System Interoperability
Data Validation and System Interoperability
Safe Software
 
Integration of Utility Data into 3D BIM Models Using a 3D Solids Modeling Wor...
Integration of Utility Data into 3D BIM Models Using a 3D Solids Modeling Wor...
Safe Software
 
AI vs Human Writing: Can You Tell the Difference?
AI vs Human Writing: Can You Tell the Difference?
Shashi Sathyanarayana, Ph.D
 
Crypto Super 500 - 14th Report - June2025.pdf
Crypto Super 500 - 14th Report - June2025.pdf
Stephen Perrenod
 
Raman Bhaumik - Passionate Tech Enthusiast
Raman Bhaumik - Passionate Tech Enthusiast
Raman Bhaumik
 
OWASP Barcelona 2025 Threat Model Library
OWASP Barcelona 2025 Threat Model Library
PetraVukmirovic
 
SAP Modernization Strategies for a Successful S/4HANA Journey.pdf
SAP Modernization Strategies for a Successful S/4HANA Journey.pdf
Precisely
 
FIDO Seminar: Evolving Landscape of Post-Quantum Cryptography.pptx
FIDO Seminar: Evolving Landscape of Post-Quantum Cryptography.pptx
FIDO Alliance
 
No-Code Workflows for CAD & 3D Data: Scaling AI-Driven Infrastructure
No-Code Workflows for CAD & 3D Data: Scaling AI-Driven Infrastructure
Safe Software
 
FIDO Seminar: Authentication for a Billion Consumers - Amazon.pptx
FIDO Seminar: Authentication for a Billion Consumers - Amazon.pptx
FIDO Alliance
 
High Availability On-Premises FME Flow.pdf
High Availability On-Premises FME Flow.pdf
Safe Software
 
Murdledescargadarkweb.pdfvolumen1 100 elementary
Murdledescargadarkweb.pdfvolumen1 100 elementary
JorgeSemperteguiMont
 
“From Enterprise to Makers: Driving Vision AI Innovation at the Extreme Edge,...
“From Enterprise to Makers: Driving Vision AI Innovation at the Extreme Edge,...
Edge AI and Vision Alliance
 
OpenACC and Open Hackathons Monthly Highlights June 2025
OpenACC and Open Hackathons Monthly Highlights June 2025
OpenACC
 
Down the Rabbit Hole – Solving 5 Training Roadblocks
Down the Rabbit Hole – Solving 5 Training Roadblocks
Rustici Software
 
FIDO Seminar: Targeting Trust: The Future of Identity in the Workforce.pptx
FIDO Seminar: Targeting Trust: The Future of Identity in the Workforce.pptx
FIDO Alliance
 
Supporting the NextGen 911 Digital Transformation with FME
Supporting the NextGen 911 Digital Transformation with FME
Safe Software
 
Providing an OGC API Processes REST Interface for FME Flow
Providing an OGC API Processes REST Interface for FME Flow
Safe Software
 
Edge-banding-machines-edgeteq-s-200-en-.pdf
Edge-banding-machines-edgeteq-s-200-en-.pdf
AmirStern2
 
Reducing Conflicts and Increasing Safety Along the Cycling Networks of East-F...
Reducing Conflicts and Increasing Safety Along the Cycling Networks of East-F...
Safe Software
 
Data Validation and System Interoperability
Data Validation and System Interoperability
Safe Software
 
Integration of Utility Data into 3D BIM Models Using a 3D Solids Modeling Wor...
Integration of Utility Data into 3D BIM Models Using a 3D Solids Modeling Wor...
Safe Software
 
AI vs Human Writing: Can You Tell the Difference?
AI vs Human Writing: Can You Tell the Difference?
Shashi Sathyanarayana, Ph.D
 
Crypto Super 500 - 14th Report - June2025.pdf
Crypto Super 500 - 14th Report - June2025.pdf
Stephen Perrenod
 
Raman Bhaumik - Passionate Tech Enthusiast
Raman Bhaumik - Passionate Tech Enthusiast
Raman Bhaumik
 
OWASP Barcelona 2025 Threat Model Library
OWASP Barcelona 2025 Threat Model Library
PetraVukmirovic
 
SAP Modernization Strategies for a Successful S/4HANA Journey.pdf
SAP Modernization Strategies for a Successful S/4HANA Journey.pdf
Precisely
 
FIDO Seminar: Evolving Landscape of Post-Quantum Cryptography.pptx
FIDO Seminar: Evolving Landscape of Post-Quantum Cryptography.pptx
FIDO Alliance
 
No-Code Workflows for CAD & 3D Data: Scaling AI-Driven Infrastructure
No-Code Workflows for CAD & 3D Data: Scaling AI-Driven Infrastructure
Safe Software
 
FIDO Seminar: Authentication for a Billion Consumers - Amazon.pptx
FIDO Seminar: Authentication for a Billion Consumers - Amazon.pptx
FIDO Alliance
 
High Availability On-Premises FME Flow.pdf
High Availability On-Premises FME Flow.pdf
Safe Software
 
Murdledescargadarkweb.pdfvolumen1 100 elementary
Murdledescargadarkweb.pdfvolumen1 100 elementary
JorgeSemperteguiMont
 
“From Enterprise to Makers: Driving Vision AI Innovation at the Extreme Edge,...
“From Enterprise to Makers: Driving Vision AI Innovation at the Extreme Edge,...
Edge AI and Vision Alliance
 
OpenACC and Open Hackathons Monthly Highlights June 2025
OpenACC and Open Hackathons Monthly Highlights June 2025
OpenACC
 
Down the Rabbit Hole – Solving 5 Training Roadblocks
Down the Rabbit Hole – Solving 5 Training Roadblocks
Rustici Software
 
FIDO Seminar: Targeting Trust: The Future of Identity in the Workforce.pptx
FIDO Seminar: Targeting Trust: The Future of Identity in the Workforce.pptx
FIDO Alliance
 
Supporting the NextGen 911 Digital Transformation with FME
Supporting the NextGen 911 Digital Transformation with FME
Safe Software
 
Providing an OGC API Processes REST Interface for FME Flow
Providing an OGC API Processes REST Interface for FME Flow
Safe Software
 
Edge-banding-machines-edgeteq-s-200-en-.pdf
Edge-banding-machines-edgeteq-s-200-en-.pdf
AmirStern2
 

PostgreSQL and CockroachDB SQL

Editor's Notes

  • #4: This is a PostgreSQL meetup, why should I care about CockroachDB? The CockroachDB SQL grammar is based on the Postgres grammar. Postgres is a SQL database. CockroachDB is a distributed SQL database.
  • #5: Layered abstractions make it possible to deal with complexity Higher levels can treat lower levels as functional black boxes
  • #6: Top two layers are logical Don’t stop at SQL!
  • #8: Monolithic sorted map is distributed layer
  • #9: RocksDB at physical layer
  • #16: This is a brief overview of logical data storage in PostgreSQL. I’m using the term “logical” to refer to how SQL data is mapped down into PostgreSQL structures and distinguishing it from “physical” data storage which is exactly how those structures are implemented.
  • #17: The heap structure is unindexed storage of row tuples. Think of it as a hash table where rows are given a unique id at insertion time, except that it is unfortunately not that simple. Tuples (rows) are located by a tuple ID which is composed of a page# and item# within the page. A Btree stores values sorted by key. Btree index key is a tuple of the columns in the index. Value is the row’s tuple ID.
  • #18: An example will make this clearer.
  • #22: Tuple IDs just happen to be ordered in this example. They are not in general. And tuple IDs are an internal detail of tables and not stable for external usage.
  • #38: Row sentinel!
  • #39: Row sentinel!
  • #40: Row sentinel!
  • #41: Value contains any primary key column that is not stored in index key.
  • #42: Value contains any primary key column that is not stored in index key.
  • #43: Value contains any primary key column that is not stored in index key.
  • #44: Value contains any primary key column that is not stored in index key.
  • #45: Value contains any primary key column that is not stored in index key.
  • #57: Poll audience about experience with production schema change.