Build a concurrent cache in Rust

Rust India Conference 2026 hands-on workshop

Tickets

Loading…

🧱 Workshop overview

This workshop teaches Rust through the hands-on evolution of a simple in-memory cache into a concurrent, type-safe system.

Instead of learning Rust concepts in isolation, participants will incrementally build a real system and encounter core ideas - ownership, borrowing, concurrency, and type-driven design - as natural solutions to real problems.

Along the way, we’ll explore how Rust:

  • Enables safe shared mutability
  • Eliminates classes of runtime bugs
  • Uses the type system to make illegal states unrepresentable

This workshop can be attended in-person in Bengaluru or remotely (live).

Workshop level: suitable for beginners


🎯 Key takeaways

By the end of the workshop, participants will:

  • Understand Rust’s ownership and borrowing model through practice

  • Design APIs using Rust’s type system

  • Work with concurrency primitives: Mutex, RwLock, Arc

  • Understand interior mutability and atomics vs locks

  • Learn Rust’s memory model and the MESI cache coherence protocol

  • Apply common Rust patterns:

    • Newtype
    • RAII
    • Interior Mutability
    • Builder
    • Typestate

About the instructor

Sarthak Makhija is Principal Architect at Caizin. He writes long-form essays on refactoring, storage engines, databases, and engineering trade-offs at https://tech-lessons.in/en/


👥 Who should attend

  • Engineers new to Rust looking for hands-on learning
  • Backend/systems engineers exploring Rust’s concurrency model
  • Developers familiar with Go, Java, etc. wanting to understand Rust’s design philosophy
  • Engineers interested in building safe, concurrent systems

📋 Prerequisites

Required

  • Basic programming experience (any language)
  • Familiarity with functions, structs/classes, and collections

Optional

  • Basic understanding of concurrency (threads, locks)
  • Exposure to systems programming concepts
  • Some familiarity with Rust

💻 Setup requirements - install before the workshop

  • Latest stable Rust toolchain (rustup)

  • Verify installation:

    rustc --version
    cargo --version
    
  • A code editor

  • Git


🧩 Workshop structure

Stage 1: Basic Cache

  • Build a simple cache using HashMap<String, String>
  • Implement get and put
  • Understand ownership, String vs &str

Focus: Rust basics, memory allocation, ownership


Stage 2: Type Safety with Newtypes

  • Introduce Key and Value types
  • Prevent type-mixing errors

Focus: Type safety, zero-cost abstractions


Stage 3: Generics & Trait Bounds

  • Generalize to Cache<K, V>
  • Introduce Eq, Hash, and Borrow

Focus: Generics, trait bounds, performance


Stage 4: Mutability & API Design

  • Introduce get_mut
  • Use Entry API

Focus: Borrow checker, safe mutation


Stage 5: Interior Mutability

  • Introduce RefCell

Focus: Interior mutability pattern


Stage 6: Concurrency Begins (Mutex + RAII)

  • Add thread safety with Mutex
  • Introduce RAII and Send / Sync

Focus: Concurrency fundamentals


Stage 7: Reducing Cloning (RwLock + Arc)

  • Introduce Arc<V> and RwLock

Focus: Shared ownership, performance trade-offs


Stage 8: Lifetimes & API Abstraction

  • Introduce lifetimes in structs
  • Clean up API design

Focus: Lifetimes, abstraction trade-offs


Stage 9: Thread Safety Deep Dive

  • Validate correctness under concurrency

Focus: Rust’s concurrency guarantees


Stage 10: Sharding for Scalability

  • Implement sharded cache
  • Reduce contention

Focus: Systems design


Stage 11: TTL & background work

  • Add TTL and eviction
  • Introduce background threads

Focus: Coordination across components


Stage 12: Metrics & atomics

  • Add metrics (hits, misses)
  • Introduce atomics and memory ordering

Focus: Performance, MESI protocol


Stage 13: Correctness via Typestate

  • Introduce typestate pattern

Focus: Compile-time correctness


Stage 14: Finalization & API design

  • Add tests and Builder pattern
  • Final API walkthrough

Focus: API ergonomics, production trade-offs


📚 References


How to attend

This is a hybrid workshop — you can attend:

  • In-person in Bengaluru, or
  • Remotely (live online)

To participate, please purchase a workshop ticket for 17 April.

Note:

  • Conference tickets do not include workshop access
  • A valid workshop ticket is required for both in-person and remote participation
  • Seats (both in-person and remote) are limited

Contact

Hosted by

A community of Rust language contributors and end-users from Bangalore. We have presence on the following telegram channels https://t.me/RustIndia https://t.me/fpncr LinkedIn: https://www.linkedin.com/company/rust-india/ X/Twitter: https://x.com/IndiaRust more