Open Source · Built with Go

In-memory key-value store.

A blazing-fast, Redis-inspired database built from scratch. LRU eviction, TTL, persistence, TCP & HTTP — all in one lightweight binary.

memQ-cli

memQ>SET user:1 "Alice"
OK
memQ>GET user:1
"Alice"
memQ>SETEX session:abc 3600 "token"
OK (expires in 3600s)
memQ>STATS
Keys: 2 | Capacity: 1000 | Hits: 1 | Misses: 0

Everything you need

11 production-ready features built from the ground up. No dependencies, no bloat — just pure Go performance.

In-Memory Store

High-performance hashmap-backed store with O(1) Get, Set, and Delete. Built on a custom doubly-linked list.

LRU Eviction

Least Recently Used eviction policy automatically removes stale entries when capacity is reached.

Time-To-Live (TTL)

Set expiration on any key with SETEX and EXPIRE. Background cleaner automatically purges expired entries.

TCP Server (RESP)

Redis-compatible TCP server using RESP serialization. Connect with netcat or any Redis client library.

HTTP REST API

Full REST API with JSON endpoints for key management, statistics, and snapshot operations.

Interactive CLI

Full-featured terminal REPL with 15+ commands including SET, GET, SETEX, TTL, STATS, SAVE, and LOAD.


Quick Start

Clone, build, connect. Three steps to your own in-memory store.

1Install & Run

# Clone the repo
$ git clone https://github.com/satwaraa/memQ.git
$ cd memQ
# Run the server
$ go run cmd/kvstore/main.go

2Connect

# Via Netcat
$ nc localhost 6379
→ SET name Alice
+OK
# Via HTTP
$ curl localhost:8080/keys/name
{"key":"name","value":"Alice"}

Roadmap

Planned features for production deployment.

  • Multiple Data Types (Lists, Sets)
  • Memory-Based Eviction
  • Pub/Sub Messaging
  • Benchmarks & Profiling
  • CI/CD workflow
  • Prometheus Metrics