At the Generalist Engineer meetup on March 15, Nadav Har’El will talk about writing modern server applications, or how we made Cassandra ten times faster and lived to tell about it. The event will take place from 6PM-8PM at Singtel, Rothschild Blvd 3, 17th floor, Tel Aviv-Yafo.
Nadav is a “Generalist Engineer” with a diverse 20-year programming career. In the past, he worked on high-performance scientific computing, networking software, information retrieval and data mining, Hebrew language processing, and x86 virtualization. More recently Nadav was part of a small team writing a new operating system for virtual machines (OSv), and today he is working on the Seastar C++ framework and on Scylla.
How multi-core is changing application design
We begin by looking at programming mistakes which slow down server software on modern multi-core servers, and how operating system APIs and programming practices that served us well for years are no longer suitable for performance-oriented server software. New trends in application design, such as event-driven programming and fast user-space packet processing, have significantly improved the performance of simple applications but proved impractical for more complex applications.
In this talk, we introduce Seastar, a new open-source C++ framework for writing server applications which are both fast and complex. Seastar enforces efficient multi-core performance by having just a single thread per core, and by working on different subsets of the data on different cores (“sharding”). At the same time, Seastar allows building highly complex applications: Programming in Seastar is based on futures and continuations. Futures provide unified access to different types of asynchronous events such as network and filesystem events, and make it easy to compose complex asynchronous events out of simpler building blocks.
We demonstrate how several state-of-the-art server applications, including Memcached and Cassandra, have been successfully rewritten in Seastar, performing a staggering 4 to 10 times faster than the original application. Finally, we introduce Scylla, a complete re-implementation of Cassandra (the popular NoSQL database) in C++ and Seastar. Scylla achieves a throughput 10 times better than the original Cassandra—with lower and more consistent latencies.