GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com β€” GitHub - arshc0der/VoltCache: High-performance multithreaded in-memory key-value store in C++17 with Reader-Writer locks and Write-Ahead Logging (WAL) for crash-safe durability

BranchesTags
Open more actions menu

Latest commit

 

History

8 Commits
8 Commits

Folders and files

NameName
Last commit message
Last commit date
Testing
Testing
 
 
include
include
 
 
src
src
 
 
.gitattributes
.gitattributes
 
 
.gitignore
.gitignore
 
 
CMakeLists.txt
CMakeLists.txt
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 

Repository files navigation


⚑ VoltCache

High-Performance In-Memory Key-Value Engine (C++17)

VoltCache


πŸš€ Overview

VoltCache is a lightweight, high-performance, multithreaded in-memory key-value store built in C++17.

It is engineered to deliver:

  • ⚑ Ultra-low latency reads
  • πŸ”’ Thread-safe concurrent access
  • πŸ’Ύ Durable persistence via Write-Ahead Logging (WAL)
  • 🧡 Modern C++ synchronization using RAII

Designed to simulate production-grade caching systems like Redis β€” but implemented from scratch to demonstrate deep systems-level understanding.


✨ Key Features

🧡 Thread-Safe Concurrency

  • Implements Reader-Writer Lock pattern
  • Uses std::shared_mutex
  • Unlimited concurrent reads
  • Exclusive writes via std::unique_lock
  • RAII-based lock safety

πŸ’Ύ Durability with Write-Ahead Logging

  • Every SET operation is logged before memory mutation
  • Log file: data/volt.log
  • Crash recovery via automatic WAL replay
  • Prevents recursive re-logging during restore

πŸ“¦ Structured Data Support

  • Advanced token parsing

  • Stores:

    • Strings with spaces
    • Delimiter-safe values
    • JSON payloads

βš™οΈ Zero Dependency Build

  • Fully managed via CMake
  • No external libraries
  • Portable across Windows & Linux

πŸ— Architecture

Client Threads
      β”‚
      β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  Shared Hash Map      β”‚
β”‚  (std::unordered_map) β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
      β–²
      β”‚
 Reader-Writer Lock
      β”‚
      β–Ό
 Write-Ahead Log (WAL)

Concurrency Model

Operation Lock Type Behavior
GET shared_lock Concurrent
SET unique_lock Exclusive
WAL Flush File I/O Synchronous

πŸ”„ Crash Recovery Flow

  1. Detect data/volt.log
  2. Parse commands line-by-line
  3. Inject data directly into memory
  4. Skip logging during recovery phase
  5. Restore complete state

πŸ“‚ Project Structure

VoltCache/
β”œβ”€β”€ include/           # Engine declarations
β”œβ”€β”€ src/               # Server & engine implementation
β”œβ”€β”€ Testing/           # Python integration tests
β”œβ”€β”€ data/              # WAL persistence layer
β”œβ”€β”€ CMakeLists.txt
└── README.md

βš™οΈ Installation

πŸ”§ Requirements

  • CMake 3.10+
  • GCC / MinGW-w64 (UCRT64 recommended)
  • Python 3 (for integration tests)

πŸ— Build

mkdir build && cd build
cmake -G "MinGW Makefiles" ..
cmake --build .

β–Ά Run Server

./VoltCache

πŸ§ͺ Run Integration Tests

python Testing/test_volt.py

πŸ“ˆ Performance Goals

  • O(1) average lookup (hash map)
  • Minimal lock contention
  • WAL durability with low overhead
  • Safe concurrent client simulation

πŸ—Ί Roadmap

  • LRU Eviction Policy (O(1) eviction via list + hashmap)
  • Lock Striping (16 bucket sharding)
  • GoogleTest unit coverage
  • Benchmark suite (throughput + latency metrics)
  • Optional async WAL mode
  • Snapshotting mechanism

🧠 Design Philosophy

VoltCache is built to demonstrate:

  • Advanced C++17 mastery
  • RAII-driven concurrency safety
  • File I/O durability guarantees
  • Real-world system design principles

This is not just a CRUD store β€” it’s a mini database engine.


πŸ† Why VoltCache Stands Out

βœ” Fully thread-safe architecture

βœ” Persistent durability layer

βœ” Clean modular structure

βœ” Zero third-party dependencies

Built as a foundational stepping stone toward distributed caching and database engines.


🀝 Contributing

Contributions are welcome. If you'd like to improve performance, add benchmarking, or implement eviction strategies β€” open a PR.


About

High-performance multithreaded in-memory key-value store in C++17 with Reader-Writer locks and Write-Ahead Logging (WAL) for crash-safe durability

Topics

backendconcurrencycpp17database-enginehigh-performancein-memory-databasekey-value-storelow-latencymultithreadingnetwork-programmingreader-writer-lockshared-mutexsystems-programmingtcp-serverwalwrite-ahead-logging

Resources

Readme
MIT license
Activity

Stars

3 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402775 β€” GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800Γ—600. No cookies required.