What is PugDB?

PugDB is a privacy-first, Rust-native key-value store designed for high-performance applications. Built with modern Rust and optimized for speed, reliability, and data sovereignty.

Beta Status: PugDB is currently in beta. Core features are stable and well-tested, but the project is still under active development. Some advanced features may change before the production release.

Core Definition

PugDB is a high-performance key-value storage system that provides:

  • Verified Performance: 5.8x faster than PostgreSQL, 3.5x faster than ScyllaDB (YCSB benchmarks, single-threaded sequential workload)
  • Low Latency: P50 latency 0.029-0.072ms, P99 latency 0.076-0.272ms
  • Stable Core (Beta): 5,456 tests passing (100% pass rate), 62.43% code coverage (as of January 2026)
  • Privacy-First Design: Built with encryption support, audit logging, and offline-first capabilities
  • Rust-Native: Leverages Rust's memory safety and modern async/await patterns

Key Characteristics

High Performance

PugDB delivers exceptional performance with verified YCSB benchmarks (last updated: January 2026) showing 5.8x faster throughput than PostgreSQL and 3.5x faster than ScyllaDB on single-threaded sequential workloads. The system is optimized for low latency, with P50 latency of 0.029-0.072ms and P99 latency of 0.076-0.272ms across all workloads.

Rust-Native Architecture

Built entirely in Rust, PugDB leverages:

  • Async/Await: Full Tokio integration for excellent concurrency
  • Memory Safety: Rust's compile-time guarantees eliminate entire classes of bugs
  • Modern Patterns: Clean, idiomatic Rust code that's maintainable and performant

Multi-Language Support via FFI

While PugDB is built in Rust, it can be used from any programming language through C-compatible FFI bindings:

  • C/C++: Direct C-compatible API for native integration
  • Python, Go, Node.js: Language bindings can be built on top of the C FFI
  • Zero Overhead: FFI bindings provide direct access to PugDB's core functionality
  • Cross-Platform: Works on all platforms where Rust compiles

The FFI crate (f4kvs-ffi) provides a stable C API that enables integration with virtually any programming language, making PugDB accessible beyond the Rust ecosystem.

Stable Core (Beta)

The foundation of PugDB is stable and well-tested:

  • Core key-value operations (get, put, delete, exists)
  • Memory storage engines (HashMap, BTreeMap) - Beta - Well Tested
  • Graceful shutdown and recovery
  • Memory leak detection
  • Monitoring hooks and metrics collection

Privacy-Focused Design

PugDB is built with privacy and data sovereignty in mind:

  • Encryption support for data at rest and in transit
  • Audit logging capabilities
  • Offline-first architecture
  • Local-first data storage patterns

Modular Architecture

PugDB follows a clean, layered architecture that separates concerns:

  • Foundation Layer: Core abstractions and memory storage
  • Extensions Layer: Advanced storage engines, query language, monitoring
  • Distributed Layer: Server, client, and clustering capabilities
  • Cloud Layer: S3-compatible storage and intelligent tiering
  • Application Layer: CLI tools and utilities

Main Features

Multiple Storage Engines

  • Memory Storage: HashMap and BTreeMap backends - Beta - Well Tested (813 tests, 80%+ coverage)
  • LSM-Tree Storage: Beta - Well Tested - 51 unit tests + integration tests, comprehensive crash recovery
  • Partitioned Storage: Beta - Well Tested - Extensive integration tests, 6+ test suites, stress-tested concurrency

Compression Support

Efficient data compression with multiple algorithms: LZ4, Zstd, Gzip, and Snappy.

Monitoring and Metrics

Built-in observability for production deployments: Prometheus metrics integration, health check endpoints, performance monitoring hooks, and resource usage tracking.

Query Language

Beta (Approaching Production) SQL support with 856+ tests passing: Window functions (100% complete, GA), JOINs (100% complete, GA), subqueries (95% complete, GA), query optimization (100% complete), and transactions (90% complete).

Performance Highlights

PugDB's performance has been verified through extensive YCSB benchmarking with proper isolation and statistical validation (last updated: January 2026):

  • Throughput: 5.8x faster than PostgreSQL (4.3x - 7.9x range), 3.5x faster than ScyllaDB (2.3x - 4.4x range)
  • Latency: P50 latency 0.029-0.072ms, P99 latency 0.076-0.272ms
  • Batch Operations: Optimized with connection reuse
  • Concurrency: Excellent scaling up to 32 threads
  • Memory Efficiency: Consistent performance with memory pools

*Benchmark Methodology: Results from single-threaded sequential YCSB workloads. Both PugDB and competitors tested identically. Real-world performance with concurrent workloads may differ.*

Quality Metrics

PugDB maintains high quality standards with comprehensive testing:

  • Test Coverage: 5,456 tests passing (100% pass rate)
  • Code Coverage: 62.43% overall (regions: 62.43%, functions: 62.57%, lines: 61.95%) - as of January 2026
  • Stable Components (Beta): Core, storage, network, and clustering layers are stable and well-tested
  • Beta Components: Query language (856+ tests) and observability approaching production

Note: PugDB is the new name for F4KVS. All references to F4KVS in documentation and code will gradually transition to PugDB.