Sarthak Makhija
Sarthak Makhija Databases & Storage Systems
Sarthak Makhija
Sarthak Makhija Databases & Storage Systems

Build a concurrent cache in Rust

Format: Instructor-led training Duration: 2 days Availability: On request

Rather than focusing just on syntax, this workshop takes a deep dive into Rust internals by looking at actual source code while building a production-ready system.

Workshop Curriculum

A step-by-step journey from basic memory allocation to highly concurrent sharded caching.

Module 1

Foundations & Type Safety

  • Foundations: In-memory caching and ownership model basic constraints
  • Type Safety: Overcoming primitive obsession with the NewType pattern and trait derivations
  • Generics: Creating generic abstractions with Trait bounds and standard Library Borrow trait
Module 2

Memory & Concurrency

  • Mutation vs Aliasing: Rust borrow checker rules, lifetimes, and interior mutability via RefCell
  • Fearless Concurrency: Implementing thread safety using Mutex, RwLock, and RAII locks
  • Reference Counting: Utilizing Arc for shared ownership across concurrent threads
Module 3

Zero-Copy & Scale

  • Zero-Copy: Advanced memory layouts, custom references, and lifetime anchoring
  • Send & Sync: Understanding compile-time guarantees for concurrent programming
  • Scale & Sharding: Reducing lock contention by designing and implementing cache sharding
Module 4

Real-World Mechanics

  • Cache Expiration: Implementing Time-To-Live (TTL) with lazy cleanups and background cleanups
  • Atomic Mechanics: Cache line optimization, False Sharing mitigation, and MESI protocol
  • Type-States: Using type-state API patterns to enforce compile-time safety during shutdown

After this training, you will be able to

  • 1. Apply advanced memory management concepts, lifetimes, and zero-copy references to avoid unnecessary allocations
  • 2. Design and write thread-safe concurrent systems using mutexes, read-write locks, atomics, and sharding
  • 3. Leverage Rust's type system (NewType, Generics, Type-States) to turn run-time errors into compile-time proofs

Interested in running this training for your team?

This workshop is customized for engineering teams at tech startups and enterprises looking to adopt Rust for systems programming.