cockroachdb - fernando ipar · 2020. 4. 30. · fernando ipar / open source persistence meetup /...
TRANSCRIPT
![Page 1: CockroachDB - Fernando Ipar · 2020. 4. 30. · Fernando Ipar / Open Source Persistence Meetup / Nov 2016 A database for the zombie apocalypse CockroachDB](https://reader033.vdocuments.us/reader033/viewer/2022051814/6035bd19f95a8b2d2a40ada7/html5/thumbnails/1.jpg)
Fernando Ipar / Open Source Persistence Meetup / Nov 2016
A database for the zombie apocalypse
CockroachDB
![Page 2: CockroachDB - Fernando Ipar · 2020. 4. 30. · Fernando Ipar / Open Source Persistence Meetup / Nov 2016 A database for the zombie apocalypse CockroachDB](https://reader033.vdocuments.us/reader033/viewer/2022051814/6035bd19f95a8b2d2a40ada7/html5/thumbnails/2.jpg)
© The Pythian Group Inc., 2017
stress-free cockroachdb DBA
Zombie Apocalypse
![Page 3: CockroachDB - Fernando Ipar · 2020. 4. 30. · Fernando Ipar / Open Source Persistence Meetup / Nov 2016 A database for the zombie apocalypse CockroachDB](https://reader033.vdocuments.us/reader033/viewer/2022051814/6035bd19f95a8b2d2a40ada7/html5/thumbnails/3.jpg)
© The Pythian Group Inc., 2017 !3
![Page 4: CockroachDB - Fernando Ipar · 2020. 4. 30. · Fernando Ipar / Open Source Persistence Meetup / Nov 2016 A database for the zombie apocalypse CockroachDB](https://reader033.vdocuments.us/reader033/viewer/2022051814/6035bd19f95a8b2d2a40ada7/html5/thumbnails/4.jpg)
© The Pythian Group Inc., 2017
●SQL (postgresql dialect)
●ACID
●Distributed (serializable isolation level guaranteed)
●Synchronous replication
●Auto sharding (ranges)
●No dependencies on special hardware (read: works with just NTP)
●Correct First.
●CP in CAP
!4
CockroachDB Intro
![Page 5: CockroachDB - Fernando Ipar · 2020. 4. 30. · Fernando Ipar / Open Source Persistence Meetup / Nov 2016 A database for the zombie apocalypse CockroachDB](https://reader033.vdocuments.us/reader033/viewer/2022051814/6035bd19f95a8b2d2a40ada7/html5/thumbnails/5.jpg)
© The Pythian Group Inc., 2017
Bad for:
- Complex Joins (being improved)
- OLAP
!5
Good for:
- Distributed or replicated OLTP
- Multi-datacenter deployments
- Cloud-native infrastructure
CockroachDB current use cases
![Page 6: CockroachDB - Fernando Ipar · 2020. 4. 30. · Fernando Ipar / Open Source Persistence Meetup / Nov 2016 A database for the zombie apocalypse CockroachDB](https://reader033.vdocuments.us/reader033/viewer/2022051814/6035bd19f95a8b2d2a40ada7/html5/thumbnails/6.jpg)
© The Pythian Group Inc., 2017 !6
CockroachDB LayersSQL
Transactional
Distribution
Replication
Storage
![Page 7: CockroachDB - Fernando Ipar · 2020. 4. 30. · Fernando Ipar / Open Source Persistence Meetup / Nov 2016 A database for the zombie apocalypse CockroachDB](https://reader033.vdocuments.us/reader033/viewer/2022051814/6035bd19f95a8b2d2a40ada7/html5/thumbnails/7.jpg)
© The Pythian Group Inc., 2017 !7
CockroachDB
Monolithic Sorted Map
system data user data
![Page 8: CockroachDB - Fernando Ipar · 2020. 4. 30. · Fernando Ipar / Open Source Persistence Meetup / Nov 2016 A database for the zombie apocalypse CockroachDB](https://reader033.vdocuments.us/reader033/viewer/2022051814/6035bd19f95a8b2d2a40ada7/html5/thumbnails/8.jpg)
© The Pythian Group Inc., 2017 !8
CockroachDB
Monolithic Sorted Map
system data user data
meta1
meta2
![Page 9: CockroachDB - Fernando Ipar · 2020. 4. 30. · Fernando Ipar / Open Source Persistence Meetup / Nov 2016 A database for the zombie apocalypse CockroachDB](https://reader033.vdocuments.us/reader033/viewer/2022051814/6035bd19f95a8b2d2a40ada7/html5/thumbnails/9.jpg)
© The Pythian Group Inc., 2017
●Example for alphabetically sorted column, meta1 (taken from manual)
# Points to meta2 range for keys [A-M)
meta1/M -> node1:26257, node2:26257, node3:26257
# Points to meta2 range for keys [M-Z]
meta1/maxKey -> node4:26257, node5:26257, node6:26257
!9
CockroachDB
![Page 10: CockroachDB - Fernando Ipar · 2020. 4. 30. · Fernando Ipar / Open Source Persistence Meetup / Nov 2016 A database for the zombie apocalypse CockroachDB](https://reader033.vdocuments.us/reader033/viewer/2022051814/6035bd19f95a8b2d2a40ada7/html5/thumbnails/10.jpg)
© The Pythian Group Inc., 2017
●Example for alphabetically sorted column, meta2 (taken from manual)
# Contains [A-G)
meta2/G -> node1:26257, node2:26257, node3:26257
# Contains [G-M)
meta2/M -> node1:26257, node2:26257, node3:26257
# Contains [M-Z)
meta2/Z -> node4:26257, node5:26257, node6:26257
# Contains [Z-maxKey)
meta2/maxKey -> node4:26257, node5:26257, node6:26257
!10
CockroachDB
![Page 11: CockroachDB - Fernando Ipar · 2020. 4. 30. · Fernando Ipar / Open Source Persistence Meetup / Nov 2016 A database for the zombie apocalypse CockroachDB](https://reader033.vdocuments.us/reader033/viewer/2022051814/6035bd19f95a8b2d2a40ada7/html5/thumbnails/11.jpg)
© The Pythian Group Inc., 2017 !11
CockroachDB
node1 node2 node3
node4 node5 node6
A-G
G-M
A-G
G-M
A-G
G-M
M-Z
Z-∞
M-Z
Z-∞
M-Z
Z-∞
![Page 12: CockroachDB - Fernando Ipar · 2020. 4. 30. · Fernando Ipar / Open Source Persistence Meetup / Nov 2016 A database for the zombie apocalypse CockroachDB](https://reader033.vdocuments.us/reader033/viewer/2022051814/6035bd19f95a8b2d2a40ada7/html5/thumbnails/12.jpg)
© The Pythian Group Inc., 2017 !12
CockroachDB node1 node2 node3
node4 node5 node6
A-G
G-M
A-G
G-M
A-G
G-M
M-Z
Z-∞
M-Z
Z-∞
M-Z
Z-∞
RAFT
GROUP
![Page 13: CockroachDB - Fernando Ipar · 2020. 4. 30. · Fernando Ipar / Open Source Persistence Meetup / Nov 2016 A database for the zombie apocalypse CockroachDB](https://reader033.vdocuments.us/reader033/viewer/2022051814/6035bd19f95a8b2d2a40ada7/html5/thumbnails/13.jpg)
© The Pythian Group Inc., 2017 !13
CockroachDB node1 node2 node3
node4 node5 node6
A-G
G-M
A-G
G-M
A-G
G-M
M-Z
Z-∞
M-Z
Z-∞
M-Z
Z-∞
RAFT
GROUP
leaseholder for group
![Page 14: CockroachDB - Fernando Ipar · 2020. 4. 30. · Fernando Ipar / Open Source Persistence Meetup / Nov 2016 A database for the zombie apocalypse CockroachDB](https://reader033.vdocuments.us/reader033/viewer/2022051814/6035bd19f95a8b2d2a40ada7/html5/thumbnails/14.jpg)
© The Pythian Group Inc., 2017 !14
THANK YOUWe are hiring!