TinyKV is a local application memory runtime built in Go.
The goal is simple: start with a small command-line key-value store, then gradually grow it into a serious local cache/runtime with TTLs, concurrency safety, daemon mode, observability, and migration tooling.
This is not trying to be Redis on day one.
TinyKV is a learning-first infrastructure project designed to build real systems programming skill through progressively harder milestones.
Most applications eventually need some kind of fast temporary memory:
- cached API responses
- counters
- session-like data
- temporary workflow state
- short-lived lookup data
- local development cache
Usually, developers reach for Redis early, even when the application may not need a networked external cache yet.
TinyKV explores a smaller idea:
What if an application could start with simple local memory, then grow toward a daemonized runtime when needed?
TinyKV is currently in Phase 1: Go Foundations & CLI Store.
The current focus is building a clean command-line key-value store while learning Go fundamentals.
SETGETDELEXISTSLISTHELPEXIT
The following are intentionally out of scope for the first phase:
- networking
- persistence
- concurrency
- daemon mode
- distributed systems
The point of Phase 1 is to build the foundation correctly before adding complexity.
TinyKV is being built to learn and demonstrate:
- Go syntax and project structure
- structs, methods, maps, and slices
- command parsing
- package organization
- unit testing
- cache design
- TTL and expiration logic
- concurrency with goroutines and mutexes
- daemon architecture
- local networking
- Unix sockets
- memory management
- observability
- open-source infrastructure practices
Build a working CLI key-value store.
Core commands:
SET <key> <value>
GET <key>
DEL <key>
EXISTS <key>
LIST
HELP
EXITDeliverables:
- working CLI
- unit tests
- README
Transform the store into a real cache.
Planned features:
- TTL support
- expiration timestamps
- background cleanup worker
INCRDECR- namespaces
- thread-safe operations
Concepts:
- goroutines
- channels
sync.Mutexsync.RWMutex- Go
timepackage
Separate application memory from the application process.
Planned components:
appmemddaemonappmemctlCLI client- request/response protocol
- TCP localhost transport
- graceful shutdown
Move toward production-quality local communication.
Planned features:
- Unix socket support
- socket permissions
- connection pooling
- local-only runtime mode
Prevent unbounded memory growth.
Planned features:
- memory limits
- LRU eviction
- access tracking
- object sizing
- stress tests
- benchmarks
Make TinyKV operable.
Planned features:
- structured logging
- metrics endpoint
- health checks
STATScommand- troubleshooting guide
Add portability.
Planned features:
- JSONL export
- JSONL import
- validation
- backup workflow
- restore workflow
Make TinyKV easier to adopt from JavaScript and TypeScript applications.
Planned features:
- TypeScript client
- typed APIs
- examples for Express, NestJS, and Next.js
- npm package
Allow users to graduate from TinyKV.
Planned features:
- Redis export
- database export
- migration reports
- migration CLI
Prepare the project for public use and contribution.
Planned features:
- CI/CD
- release automation
- Docker image
- Homebrew package
- architecture documentation
- contributing guide
- benchmarks
A distributed memory runtime may be explored later, but it is intentionally not part of the early roadmap.
Potential future features:
- replication
- consistent hashing
- failover
- rebalancing
- namespace ownership
- cluster discovery
This would turn TinyKV into a distributed systems project and should only happen after the local runtime is mature.
Current intended structure:
cmd/
TinyKV/
main.go
internal/
commands/
command.go
handler.go
store/
store.go
store_test.gocmd/TinyKVApplication entry point. Handles CLI startup and the input loop.
internal/commandsParses user input into commands and executes those commands against the store.
internal/storeOwns the key-value data model and store behavior.
The store package should not know about CLI input, terminal output, or command strings.
$ TinyKV
TinyKV CLI
Type HELP for commands
> SET name Shanil
OK
> GET name
Shanil
> EXISTS name
true
> LIST
name = Shanil
> DEL name
deleted
> GET name
(nil)
> EXIT
byeRun the CLI:
go run ./cmd/TinyKVRun tests:
go test ./...Format code:
go fmt ./...Do not build networking, persistence, or concurrency before the basic store is solid.
Command parsing belongs in the commands package.
Storage logic belongs in the store package.
The CLI should wire the system together, not contain the entire application.
TinyKV should grow through clear, understandable Go code rather than unnecessary abstractions.
This project is not only about the finished tool. It is about learning the engineering behind caches, runtimes, daemons, memory management, and observability.
This project succeeds if it helps build deep Go and systems programming skill.
Specific goals:
- learn Go deeply
- understand cache design
- understand daemon architecture
- understand concurrency
- build a useful open-source project
- document the journey clearly
Revenue is optional.
Learning is mandatory.
MIT License.