ScyllaDB Drivers: Optimizing Performance

ScyllaDB 269 views 28 slides Jun 19, 2024
Slide 1
Slide 1 of 28
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21
Slide 22
22
Slide 23
23
Slide 24
24
Slide 25
25
Slide 26
26
Slide 27
27
Slide 28
28

About This Presentation

ScyllaDB Drivers take advantage of the unique ScyllaDB architecture to deliver high performance and low latencies. Join this talk to learn more about our shard-aware drivers, their features, and best practices for working with them. The presentation will go over the new features added in 2023 as wel...


Slide Content

What’s New in ScyllaDB Drivers Piotr Grabowski, Software Team Lead at ScyllaDB

Piotr Grabowski Software Team Leader at ScyllaDB responsible for all ScyllaDB drivers, ScyllaDB Kafka Connectors (ScyllaDB Sink Connector and ScyllaDB CDC Source Connector) Joined ScyllaDB 3 years ago Your photo goes here, smile :)

Drivers 101 ScyllaDB Rust Driver Tablet Support Presentation Agenda

Drivers 101

Drivers 101 Drivers are libraries for different programming languages to connect to ScyllaDB and execute queries Cassandra drivers work out-of-the-box with ScyllaDB For optimal performance and additional features we highly recommend ScyllaDB’s drivers Some of ScyllaDB drivers are forks of Cassandra Drivers Some of ScyllaDB drivers were started from scratch by us (ScyllaDB Rust Driver)

ScyllaDB Drivers Shard aware: sending the query to a correct shard Optimized support for ScyllaDB CDC LWT Optimization: consistently prefer a single replica when executing a LWT query to avoid Paxos conflicts Tablet support Coming soon

Basic Best Practices Use prepared statements Use paged queries (important for large SELECT statements) Use an appropriate retry policy for your workload Use Scylla Monitoring to observe your application “Scylla CQL” dashboard

Learn More Drivers: https://github.com/scylladb/java-driver https://github.com/scylladb/python-driver https://github.com/scylladb/gocql https://github.com/scylladb/scylla-rust-driver Documentation: https://www.scylladb.com/product/scylla-drivers/ https://opensource.docs.scylladb.com/stable/using-scylla/drivers/ https://university.scylladb.com/courses/using-scylla-drivers/

ScyllaDB Rust Driver

ScyllaDB Rust Driver The idea was born during a hackathon in 2020 Over the almost last 4 years we continued the development Uses Tokio framework The driver is now mature, supporting many advanced features: Shard awareness Asynchronous interface with support for large concurrency Compression All CQL types Speculative execution TLS support

ScyllaDB Rust Driver 2023 was quite eventful: 9 releases (0.8.0 to 0.11.1) Load Balancing refactor Serialization refactor Rack awareness Continued stabilization of API

ScyllaDB Rust Driver - Load Balancing Refactor Inserts: ---------- allocs/req: 15.00 reallocs/req: 8.00 frees/req: 15.00 bytes allocated/req: 2458.05 bytes reallocated/req: 269.06 bytes freed/req: 2456.80 (allocated - freed)/req: 1.25 Before Inserts: ---------- allocs/req: 6.01 reallocs/req: 6.00 frees/req: 6.00 bytes allocated/req: 381.80 bytes reallocated/req: 173.05 bytes freed/req: 380.62 (allocated - freed)/req: 1.18 After

ScyllaDB Rust Driver - Load Balancing Refactor Inserts: ---------- allocs/req: 15.00 reallocs/req: 8.00 frees/req: 15.00 bytes allocated/req: 2458.05 bytes reallocated/req: 269.06 bytes freed/req: 2456.80 (allocated - freed)/req: 1.25 Before Inserts: ---------- allocs/req: 6.01 reallocs/req: 6.00 frees/req: 6.00 bytes allocated/req: 381.80 bytes reallocated/req: 173.05 bytes freed/req: 380.62 (allocated - freed)/req: 1.18 After 9 fewer allocations (-60%)

ScyllaDB Rust Driver - Load Balancing Refactor Inserts: ---------- allocs/req: 15.00 reallocs/req: 8.00 frees/req: 15.00 bytes allocated/req: 2458.05 bytes reallocated/req: 269.06 bytes freed/req: 2456.80 (allocated - freed)/req: 1.25 Before Inserts: ---------- allocs/req: 6.01 reallocs/req: 6.00 frees/req: 6.00 bytes allocated/req: 381.80 bytes reallocated/req: 173.05 bytes freed/req: 380.62 (allocated - freed)/req: 1.18 After 84% fewer bytes allocated

ScyllaDB Rust Driver Plans for 2024: Tablet support Performance improvements Stabilizing API for 1.0 release

Tablet Support (coming soon)

Tablet Support in Drivers SELECT column FROM table WHERE partition_key = “R1250GS” hash(“R1250GS”) -> replica nodes

Tablet Support in Drivers

Tablet Support in Drivers Tablet A Table: users.events Start: 0xC00010FF End: 0xDECAFBAD Replicas: Node A shard 3, node B shard 7 Tablet B Table: users.events Start: 0xFEEDC0DE End: 0xFFBADD11 Replicas: Node C shard 8, node D shard 2 …

Tablet Support in Drivers Tablet A Tablet B Tablet C …

Tablet Support in Drivers Tablet A Tablet B ?

Tablet Support in Drivers Tablet A Tablet B ?

Tablet Support in Drivers Tablet A Tablet B ?

Tablet Support in Drivers Tablet A Tablet B Tablet C

Tablet Support in Drivers Tablet A Tablet B Tablet C

Tablet Support in Drivers Tablet A Tablet B Tablet C

Tablet Support in Drivers Tablet A Tablet B Tablet C

Stay in Touch Piotr Grabowski [email protected] avelanarius
Tags