Database Performance at Scale Masterclass: Database Internals by Pavel Emelyanov and Botond Denes

ScyllaDB
ScyllaDBScyllaDB
Database Internals
Pavel Emelyanov & Botond Dénes
Hardware (and kernel) matters
■ CPU
■ Memory
■ Disk I/O
■ Networking
2
CPU
3
Share nothing
4
■ Cross-cores locking costs
○ Cache lines
○ CPU ticks
■ Amdahl’s law
Processes/Threads → Fibers
5
■ Context switch time matters
■ Enforced preemption switch also matters
■ Locking synchronization is a must
Quirks
6
■ Execution stages
■ Branch (mis)prediction
Memory
7
Allocation
8
■ Fragmentation
■ Slab-like allocation
■ Log-structured allocation
Cache control
9
■ Let kernel or application do it?
■ Caching can exist at different levels
○ Raw IO blocks
○ Decoded objects
Disk I/O
10
Types of I/O
11
■ Buffered reads/writes
■ Memory mapped IO
■ Direct IO
■ Asynchronous direct IO
○ IOUring
FS vs Disk
12
■ Filesystem adds a level of manageability
■ Extra IO operations
○ Blocks allocation
○ Inodes metadata
○ Journal
How moderns SSDs work
13
■ Random reads – YES
■ Random writes – NO
○ Blocks vs Pages
○ Internal parallelism
○ FTL and background operations
■ Sustained vs Burst throughput
■ Mixed workload handling
Networking
14
Tribute to ANK
15
■ Linux kernel TCP/IP had been kicking arses
since day 0
■ Coupled with epoll/AIO
■ Can be tuned for both
○ RPC messages ping pong
○ Data streaming
■ System calls switches still matters
DPDK
16
■ Removes extra switches
■ Works better in poll mode
IRQ binding
17
■ NIC IRQ processing times
■ NIC Soft-IRQ processing times
■ Binding IRQs (and Soft-IRQs) to specific
cores
ScyllaDB Internals
18
Predictably Low
Latencies
19
CPU
20
■ Thread-per core architecture
■ User-space scheduler
Memory
21
■ Row-cache
■ Page-cache
■ Full control over allocations
Disk I/O
22
■ Direct I/O
■ User-space scheduler
1 of 22

Recommended

P99CONF — What We Need to Unlearn About Persistent Storage by
P99CONF — What We Need to Unlearn About Persistent StorageP99CONF — What We Need to Unlearn About Persistent Storage
P99CONF — What We Need to Unlearn About Persistent StorageScyllaDB
494 views26 slides
Linux NUMA & Databases: Perils and Opportunities by
Linux NUMA & Databases: Perils and OpportunitiesLinux NUMA & Databases: Perils and Opportunities
Linux NUMA & Databases: Perils and OpportunitiesRaghavendra Prabhu
799 views21 slides
P99 Pursuit: 8 Years of Battling P99 Latency by
P99 Pursuit: 8 Years of Battling P99 LatencyP99 Pursuit: 8 Years of Battling P99 Latency
P99 Pursuit: 8 Years of Battling P99 LatencyScyllaDB
1.2K views51 slides
Caching in by
Caching inCaching in
Caching inRichardWarburton
8.9K views73 slides
Cache in Chromium: Disk Cache by
Cache in Chromium: Disk CacheCache in Chromium: Disk Cache
Cache in Chromium: Disk CacheChang W. Doh
3.1K views28 slides
Memorymapping.ppt by
Memorymapping.pptMemorymapping.ppt
Memorymapping.pptJeevanathanRavi
2 views16 slides

More Related Content

Similar to Database Performance at Scale Masterclass: Database Internals by Pavel Emelyanov and Botond Denes

Ext4 write barrier by
Ext4 write barrierExt4 write barrier
Ext4 write barrierSomdutta Roy
475 views10 slides
Mongodb meetup by
Mongodb meetupMongodb meetup
Mongodb meetupEytan Daniyalzade
3.3K views34 slides
Kafka on ZFS: Better Living Through Filesystems by
Kafka on ZFS: Better Living Through Filesystems Kafka on ZFS: Better Living Through Filesystems
Kafka on ZFS: Better Living Through Filesystems confluent
5.8K views66 slides
Threads - Why Can't You Just Play Nicely With Your Memory_ by
Threads - Why Can't You Just Play Nicely With Your Memory_Threads - Why Can't You Just Play Nicely With Your Memory_
Threads - Why Can't You Just Play Nicely With Your Memory_Robert Burrell Donkin
380 views11 slides
SSD для вашей базы данных, Петр Зайцев (Percona) by
SSD для вашей базы данных, Петр Зайцев (Percona)SSD для вашей базы данных, Петр Зайцев (Percona)
SSD для вашей базы данных, Петр Зайцев (Percona)Ontico
2.6K views56 slides
TokuDB internals / Лесин Владислав (Percona) by
TokuDB internals / Лесин Владислав (Percona)TokuDB internals / Лесин Владислав (Percona)
TokuDB internals / Лесин Владислав (Percona)Ontico
1.5K views40 slides

Similar to Database Performance at Scale Masterclass: Database Internals by Pavel Emelyanov and Botond Denes(20)

Kafka on ZFS: Better Living Through Filesystems by confluent
Kafka on ZFS: Better Living Through Filesystems Kafka on ZFS: Better Living Through Filesystems
Kafka on ZFS: Better Living Through Filesystems
confluent5.8K views
Threads - Why Can't You Just Play Nicely With Your Memory_ by Robert Burrell Donkin
Threads - Why Can't You Just Play Nicely With Your Memory_Threads - Why Can't You Just Play Nicely With Your Memory_
Threads - Why Can't You Just Play Nicely With Your Memory_
SSD для вашей базы данных, Петр Зайцев (Percona) by Ontico
SSD для вашей базы данных, Петр Зайцев (Percona)SSD для вашей базы данных, Петр Зайцев (Percona)
SSD для вашей базы данных, Петр Зайцев (Percona)
Ontico2.6K views
TokuDB internals / Лесин Владислав (Percona) by Ontico
TokuDB internals / Лесин Владислав (Percona)TokuDB internals / Лесин Владислав (Percona)
TokuDB internals / Лесин Владислав (Percona)
Ontico1.5K views
Distro Recipes 2013 : My ${favorite_linux_distro} is slow! by Anne Nicolas
Distro Recipes 2013 : My ${favorite_linux_distro} is slow!Distro Recipes 2013 : My ${favorite_linux_distro} is slow!
Distro Recipes 2013 : My ${favorite_linux_distro} is slow!
Anne Nicolas742 views
CSL Seminar presented by Cassiano Campes - 16-11-14 by Cassiano Campes
CSL Seminar presented by Cassiano Campes - 16-11-14CSL Seminar presented by Cassiano Campes - 16-11-14
CSL Seminar presented by Cassiano Campes - 16-11-14
Cassiano Campes74 views
Learn about log structured file system by Gang He
Learn about log structured file systemLearn about log structured file system
Learn about log structured file system
Gang He1.1K views
Case study of BtrFS: A fault tolerant File system by Kumar Amit Mehta
Case study of BtrFS: A fault tolerant File systemCase study of BtrFS: A fault tolerant File system
Case study of BtrFS: A fault tolerant File system
Kumar Amit Mehta2.2K views
Principles of High Load, Peter Milne, Aerospike by Dataconomy Media
Principles of High Load, Peter Milne, Aerospike Principles of High Load, Peter Milne, Aerospike
Principles of High Load, Peter Milne, Aerospike
Dataconomy Media916 views

More from ScyllaDB

Database Performance at Scale Masterclass: Workload Characteristics by Felipe... by
Database Performance at Scale Masterclass: Workload Characteristics by Felipe...Database Performance at Scale Masterclass: Workload Characteristics by Felipe...
Database Performance at Scale Masterclass: Workload Characteristics by Felipe...ScyllaDB
125 views28 slides
Database Performance at Scale Masterclass: Driver Strategies by Piotr Sarna by
Database Performance at Scale Masterclass: Driver Strategies by Piotr SarnaDatabase Performance at Scale Masterclass: Driver Strategies by Piotr Sarna
Database Performance at Scale Masterclass: Driver Strategies by Piotr SarnaScyllaDB
68 views29 slides
Replacing Your Cache with ScyllaDB by
Replacing Your Cache with ScyllaDBReplacing Your Cache with ScyllaDB
Replacing Your Cache with ScyllaDBScyllaDB
314 views63 slides
Powering Real-Time Apps with ScyllaDB_ Low Latency & Linear Scalability by
Powering Real-Time Apps with ScyllaDB_ Low Latency & Linear ScalabilityPowering Real-Time Apps with ScyllaDB_ Low Latency & Linear Scalability
Powering Real-Time Apps with ScyllaDB_ Low Latency & Linear ScalabilityScyllaDB
140 views24 slides
7 Reasons Not to Put an External Cache in Front of Your Database.pptx by
7 Reasons Not to Put an External Cache in Front of Your Database.pptx7 Reasons Not to Put an External Cache in Front of Your Database.pptx
7 Reasons Not to Put an External Cache in Front of Your Database.pptxScyllaDB
109 views68 slides
Getting the most out of ScyllaDB by
Getting the most out of ScyllaDBGetting the most out of ScyllaDB
Getting the most out of ScyllaDBScyllaDB
177 views17 slides

More from ScyllaDB(20)

Database Performance at Scale Masterclass: Workload Characteristics by Felipe... by ScyllaDB
Database Performance at Scale Masterclass: Workload Characteristics by Felipe...Database Performance at Scale Masterclass: Workload Characteristics by Felipe...
Database Performance at Scale Masterclass: Workload Characteristics by Felipe...
ScyllaDB125 views
Database Performance at Scale Masterclass: Driver Strategies by Piotr Sarna by ScyllaDB
Database Performance at Scale Masterclass: Driver Strategies by Piotr SarnaDatabase Performance at Scale Masterclass: Driver Strategies by Piotr Sarna
Database Performance at Scale Masterclass: Driver Strategies by Piotr Sarna
ScyllaDB68 views
Replacing Your Cache with ScyllaDB by ScyllaDB
Replacing Your Cache with ScyllaDBReplacing Your Cache with ScyllaDB
Replacing Your Cache with ScyllaDB
ScyllaDB314 views
Powering Real-Time Apps with ScyllaDB_ Low Latency & Linear Scalability by ScyllaDB
Powering Real-Time Apps with ScyllaDB_ Low Latency & Linear ScalabilityPowering Real-Time Apps with ScyllaDB_ Low Latency & Linear Scalability
Powering Real-Time Apps with ScyllaDB_ Low Latency & Linear Scalability
ScyllaDB140 views
7 Reasons Not to Put an External Cache in Front of Your Database.pptx by ScyllaDB
7 Reasons Not to Put an External Cache in Front of Your Database.pptx7 Reasons Not to Put an External Cache in Front of Your Database.pptx
7 Reasons Not to Put an External Cache in Front of Your Database.pptx
ScyllaDB109 views
Getting the most out of ScyllaDB by ScyllaDB
Getting the most out of ScyllaDBGetting the most out of ScyllaDB
Getting the most out of ScyllaDB
ScyllaDB177 views
NoSQL Database Migration Masterclass - Session 2: The Anatomy of a Migration by ScyllaDB
NoSQL Database Migration Masterclass - Session 2: The Anatomy of a MigrationNoSQL Database Migration Masterclass - Session 2: The Anatomy of a Migration
NoSQL Database Migration Masterclass - Session 2: The Anatomy of a Migration
ScyllaDB55 views
NoSQL Database Migration Masterclass - Session 3: Migration Logistics by ScyllaDB
NoSQL Database Migration Masterclass - Session 3: Migration LogisticsNoSQL Database Migration Masterclass - Session 3: Migration Logistics
NoSQL Database Migration Masterclass - Session 3: Migration Logistics
ScyllaDB59 views
NoSQL Data Migration Masterclass - Session 1 Migration Strategies and Challenges by ScyllaDB
NoSQL Data Migration Masterclass - Session 1 Migration Strategies and ChallengesNoSQL Data Migration Masterclass - Session 1 Migration Strategies and Challenges
NoSQL Data Migration Masterclass - Session 1 Migration Strategies and Challenges
ScyllaDB86 views
ScyllaDB Virtual Workshop by ScyllaDB
ScyllaDB Virtual WorkshopScyllaDB Virtual Workshop
ScyllaDB Virtual Workshop
ScyllaDB177 views
DBaaS in the Real World: Risks, Rewards & Tradeoffs by ScyllaDB
DBaaS in the Real World: Risks, Rewards & TradeoffsDBaaS in the Real World: Risks, Rewards & Tradeoffs
DBaaS in the Real World: Risks, Rewards & Tradeoffs
ScyllaDB165 views
Build Low-Latency Applications in Rust on ScyllaDB by ScyllaDB
Build Low-Latency Applications in Rust on ScyllaDBBuild Low-Latency Applications in Rust on ScyllaDB
Build Low-Latency Applications in Rust on ScyllaDB
ScyllaDB646 views
NoSQL Data Modeling 101 by ScyllaDB
NoSQL Data Modeling 101NoSQL Data Modeling 101
NoSQL Data Modeling 101
ScyllaDB80 views
Top NoSQL Data Modeling Mistakes by ScyllaDB
Top NoSQL Data Modeling MistakesTop NoSQL Data Modeling Mistakes
Top NoSQL Data Modeling Mistakes
ScyllaDB107 views
NoSQL Data Modeling Foundations — Introducing Concepts & Principles by ScyllaDB
NoSQL Data Modeling Foundations — Introducing Concepts & PrinciplesNoSQL Data Modeling Foundations — Introducing Concepts & Principles
NoSQL Data Modeling Foundations — Introducing Concepts & Principles
ScyllaDB188 views
Optimizing Performance in Rust for Low-Latency Database Drivers by ScyllaDB
Optimizing Performance in Rust for Low-Latency Database DriversOptimizing Performance in Rust for Low-Latency Database Drivers
Optimizing Performance in Rust for Low-Latency Database Drivers
ScyllaDB253 views
Overcoming Media Streaming Challenges with NoSQL by ScyllaDB
Overcoming Media Streaming Challenges with NoSQLOvercoming Media Streaming Challenges with NoSQL
Overcoming Media Streaming Challenges with NoSQL
ScyllaDB245 views
How Optimizely (Safely) Maximizes Database Concurrency.pdf by ScyllaDB
How Optimizely (Safely) Maximizes Database Concurrency.pdfHow Optimizely (Safely) Maximizes Database Concurrency.pdf
How Optimizely (Safely) Maximizes Database Concurrency.pdf
ScyllaDB335 views
How Development Teams Cut Costs with ScyllaDB.pdf by ScyllaDB
How Development Teams Cut Costs with ScyllaDB.pdfHow Development Teams Cut Costs with ScyllaDB.pdf
How Development Teams Cut Costs with ScyllaDB.pdf
ScyllaDB292 views
Learning Rust the Hard Way for a Production Kafka + ScyllaDB Pipeline by ScyllaDB
Learning Rust the Hard Way for a Production Kafka + ScyllaDB PipelineLearning Rust the Hard Way for a Production Kafka + ScyllaDB Pipeline
Learning Rust the Hard Way for a Production Kafka + ScyllaDB Pipeline
ScyllaDB316 views

Recently uploaded

Data-centric AI and the convergence of data and model engineering: opportunit... by
Data-centric AI and the convergence of data and model engineering:opportunit...Data-centric AI and the convergence of data and model engineering:opportunit...
Data-centric AI and the convergence of data and model engineering: opportunit...Paolo Missier
29 views40 slides
Tunable Laser (1).pptx by
Tunable Laser (1).pptxTunable Laser (1).pptx
Tunable Laser (1).pptxHajira Mahmood
21 views37 slides
Spesifikasi Lengkap ASUS Vivobook Go 14 by
Spesifikasi Lengkap ASUS Vivobook Go 14Spesifikasi Lengkap ASUS Vivobook Go 14
Spesifikasi Lengkap ASUS Vivobook Go 14Dot Semarang
35 views1 slide
Empathic Computing: Delivering the Potential of the Metaverse by
Empathic Computing: Delivering  the Potential of the MetaverseEmpathic Computing: Delivering  the Potential of the Metaverse
Empathic Computing: Delivering the Potential of the MetaverseMark Billinghurst
449 views80 slides
Throughput by
ThroughputThroughput
ThroughputMoisés Armani Ramírez
32 views11 slides
PharoJS - Zürich Smalltalk Group Meetup November 2023 by
PharoJS - Zürich Smalltalk Group Meetup November 2023PharoJS - Zürich Smalltalk Group Meetup November 2023
PharoJS - Zürich Smalltalk Group Meetup November 2023Noury Bouraqadi
113 views17 slides

Recently uploaded(20)

Data-centric AI and the convergence of data and model engineering: opportunit... by Paolo Missier
Data-centric AI and the convergence of data and model engineering:opportunit...Data-centric AI and the convergence of data and model engineering:opportunit...
Data-centric AI and the convergence of data and model engineering: opportunit...
Paolo Missier29 views
Spesifikasi Lengkap ASUS Vivobook Go 14 by Dot Semarang
Spesifikasi Lengkap ASUS Vivobook Go 14Spesifikasi Lengkap ASUS Vivobook Go 14
Spesifikasi Lengkap ASUS Vivobook Go 14
Dot Semarang35 views
Empathic Computing: Delivering the Potential of the Metaverse by Mark Billinghurst
Empathic Computing: Delivering  the Potential of the MetaverseEmpathic Computing: Delivering  the Potential of the Metaverse
Empathic Computing: Delivering the Potential of the Metaverse
Mark Billinghurst449 views
PharoJS - Zürich Smalltalk Group Meetup November 2023 by Noury Bouraqadi
PharoJS - Zürich Smalltalk Group Meetup November 2023PharoJS - Zürich Smalltalk Group Meetup November 2023
PharoJS - Zürich Smalltalk Group Meetup November 2023
Noury Bouraqadi113 views
JCon Live 2023 - Lice coding some integration problems by Bernd Ruecker
JCon Live 2023 - Lice coding some integration problemsJCon Live 2023 - Lice coding some integration problems
JCon Live 2023 - Lice coding some integration problems
Bernd Ruecker67 views
Samsung: CMM-H Tiered Memory Solution with Built-in DRAM by CXL Forum
Samsung: CMM-H Tiered Memory Solution with Built-in DRAMSamsung: CMM-H Tiered Memory Solution with Built-in DRAM
Samsung: CMM-H Tiered Memory Solution with Built-in DRAM
CXL Forum105 views
AI: mind, matter, meaning, metaphors, being, becoming, life values by Twain Liu 刘秋艳
AI: mind, matter, meaning, metaphors, being, becoming, life valuesAI: mind, matter, meaning, metaphors, being, becoming, life values
AI: mind, matter, meaning, metaphors, being, becoming, life values
Liqid: Composable CXL Preview by CXL Forum
Liqid: Composable CXL PreviewLiqid: Composable CXL Preview
Liqid: Composable CXL Preview
CXL Forum121 views
Transcript: The Details of Description Techniques tips and tangents on altern... by BookNet Canada
Transcript: The Details of Description Techniques tips and tangents on altern...Transcript: The Details of Description Techniques tips and tangents on altern...
Transcript: The Details of Description Techniques tips and tangents on altern...
BookNet Canada119 views
MemVerge: Memory Viewer Software by CXL Forum
MemVerge: Memory Viewer SoftwareMemVerge: Memory Viewer Software
MemVerge: Memory Viewer Software
CXL Forum118 views
TE Connectivity: Card Edge Interconnects by CXL Forum
TE Connectivity: Card Edge InterconnectsTE Connectivity: Card Edge Interconnects
TE Connectivity: Card Edge Interconnects
CXL Forum96 views
CXL at OCP by CXL Forum
CXL at OCPCXL at OCP
CXL at OCP
CXL Forum208 views
[2023] Putting the R! in R&D.pdf by Eleanor McHugh
[2023] Putting the R! in R&D.pdf[2023] Putting the R! in R&D.pdf
[2023] Putting the R! in R&D.pdf
Eleanor McHugh38 views
Web Dev - 1 PPT.pdf by gdsczhcet
Web Dev - 1 PPT.pdfWeb Dev - 1 PPT.pdf
Web Dev - 1 PPT.pdf
gdsczhcet52 views
Upskilling the Evolving Workforce with Digital Fluency for Tomorrow's Challen... by NUS-ISS
Upskilling the Evolving Workforce with Digital Fluency for Tomorrow's Challen...Upskilling the Evolving Workforce with Digital Fluency for Tomorrow's Challen...
Upskilling the Evolving Workforce with Digital Fluency for Tomorrow's Challen...
NUS-ISS23 views
The Importance of Cybersecurity for Digital Transformation by NUS-ISS
The Importance of Cybersecurity for Digital TransformationThe Importance of Cybersecurity for Digital Transformation
The Importance of Cybersecurity for Digital Transformation
NUS-ISS25 views
MemVerge: Past Present and Future of CXL by CXL Forum
MemVerge: Past Present and Future of CXLMemVerge: Past Present and Future of CXL
MemVerge: Past Present and Future of CXL
CXL Forum110 views

Database Performance at Scale Masterclass: Database Internals by Pavel Emelyanov and Botond Denes