Building a High Performance Application with ScyllaDB and Coroutines by João Martins
ScyllaDB
59 views
16 slides
Mar 10, 2025
Slide 1 of 16
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
About This Presentation
Learn how to build a high-performance application with ScyllaDB and Coroutines in this talk. João walks you through best practices for maximizing speed and efficiency.
Size: 1.82 MB
Language: en
Added: Mar 10, 2025
Slides: 16 pages
Slide Content
A ScyllaDB Community
Building a High Performance
Application with ScyllaDB and
Coroutines
João Victor Martins
Software Engineer
João Victor Martins (he/him)
■Senior Software Engineer at iFood
■Java / Kotlin instructor at Alura Cursos Online
■More than 10 years working with Java
■More than 4 years working with Kotlin
■https://dev.to/j_a_o_v_c_t_r/
■What is Kotlin Coroutines?
■Light-weight threads
■What is ScyllaDB?
■Let's code
■Benchmarking
Presentation Agenda
What is Kotlin Coroutines?
Kotlin Coroutines
According to the documentation, a coroutine is an instance of a
suspendable computation. It is conceptually similar to a thread, in the
sense that it takes a block of code to run that works concurrently with the
rest of the code. However, a coroutine is not bound to any particular
thread. It may suspend its execution in one thread and resume in another
one.
Coroutines can be thought of as light-weight threads, but there is a number
of important differences that make their real-life usage very different from
threads.
Lightweight threads (LTs) are a model for execution that can help with high
concurrent execution. They use less memory and have lower context
switching costs than traditional threads. LTs are generally executed on a
single thread, but they can have built-in suspension points where they give
up execution to the next LT in the queue. This process is called cooperative
execution.
Light-weight threads
What is ScyllaDB?
Scylla Database
ScyllaDB is the distributed database for data-intensive apps that
require high performance and low latency.
■Low Latency
■Our low-level design plus adaptive capabilities for prioritizing
latency-sensitive tasks keeps P99s predictably low
■High Throughput
■Sustain millions of ops/sec with low P99s. No item or partition size
limits, no throttling down your workloads
Let's code!!
Benchmarking
To ensure the application's performance, I compared it with a traditional
MVC application using the same technology stack. For benchmarking, I
used Minigun, a performance testing tool developed by iFood engineers.
■What's is minigun?
■Comparison with 100 threads
■Comparison with 1000 threads
■Comparison with 2000 threads
■Comparison with 4000 threads
Minigun
100 threads
Traditional MVC
Webflux with coroutines
1000 threads
Traditional MVC
Webflux with coroutines
2000 threads
Traditional MVC
Webflux with coroutines
4000 threads
Traditional MVC
Webflux with coroutines
Stay in Touch
João Victor Martins [email protected]
https://x.com/j_a_o_v_c_t_r
https://github.com/joao0212
https://www.linkedin.com/in/jvcmartins/