Class Central is learner-supported. When you buy through links on our site, we may earn an affiliate commission.

YouTube

Rewriting Pelikan in Rust - Performance, Reliability, and Efficiency in Caching

Rust via YouTube

Overview

Explore a conference talk that delves into the journey of incrementally rewriting a C codebase in Rust, focusing on Twitter's open-source Pelikan framework for in-memory caching. Learn about the challenges and benefits of replacing Memcached and Redis forks with a single, high-performance Rust implementation. Discover how three engineers approached adding Rust to the existing C codebase, starting with networking and event loop replacement, progressing to storage implementation, and ultimately rewriting the entire server. Gain insights into the performance improvements, reliability enhancements, and development efficiency achieved through this transition. Understand the trade-offs involved in rewriting production code, including potential missed deadlines and duplicated work. Examine the advantages of Rust's language features, tools, and abstractions in building reliable and efficient software for critical in-memory caching systems. Follow the speaker's journey from initial prototyping to production deployment, and learn about the importance of benchmarking, fuzzing, and careful testing in ensuring a successful transition from C to Rust.

Syllabus

Intro
Use Rust to: . ack Transport Layer Security (TLS) • match performance of implementation
Rust Storage in Pelikan: 2018 Engineer wants to add storage to Pelikan and write the library in Rust . Used the framework with FFI to use Rust Storage First commit of Rust to Pelikan!
Rust Server in Pelikan: 2019 Engineer wants to use Rust for server code
Prototype • Memcached protocol compatible • wrapped std::collections:: HashMapas temporary storage benchmarking looked good • next step: FFI for storage library
Rewrite Benefits new storage design • added new ideas to storage library helped make it more production ready
empowering everyone to build reliable and efficient software • high performance • code with confidence in reliability awesome language features and tools zero cost abstraction
microbenchmarking of critical components cargo fuzz easy to add fuzz testing for protocol library
Next Steps Path to Production • feature complete . more testing • production canary • deployment
Rewriting has costs and benefits Costs • Extra time would have • Easier to work with an all caused missed deadlines Rust codebase Duplicating work that's • No more cmake!!! been paid for
Cand Rust are both very fast Profiling and benchmarking helped get us match the performance of the implementation

Taught by

Rust

Reviews

Start your review of Rewriting Pelikan in Rust - Performance, Reliability, and Efficiency in Caching

Never Stop Learning.

Get personalized course recommendations, track subjects and courses with reminders, and more.

Someone learning on their laptop while sitting on the floor.