Skip to content
fascariPublic

About

Simple implementaion of an key value storage in Go

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

12 Commits

Folders and files

Repository files navigation

KV Store

A simple key-value store with distributed locking for multi-server environments.

Features

  • ✅ RESTful HTTP API
  • ✅ Distributed Locking (Redis)
  • ✅ In-Memory or Redis Storage
  • ✅ Clean Architecture
  • ✅ Comprehensive Tests

Quick Start

# Start with Redis (distributed)
make run

# Or in-memory (single server)
make run-memory

Server starts on http://localhost:8080

API Usage

Save a key

curl -X POST http://localhost:8080/api/keys \
  -H "Content-Type: application/json" \
  -d '{"key": "user:1", "value": {"name": "Alice"}}'

Retrieve a key

curl http://localhost:8080/api/keys/user:1

Delete a key

curl -X DELETE http://localhost:8080/api/keys/user:1

Health check

curl http://localhost:8080/health

Environment Variables

Variable Default Description
STORAGE_TYPE redis Storage backend: memory or redis
SERVER_PORT 8080 HTTP server port
REDIS_ADDR localhost:6379 Redis address
REDIS_PASSWORD - Redis password
REDIS_DB 0 Redis database

About

Simple implementaion of an key value storage in Go

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages